Brijesh Shah
Brijesh Shah

Reputation: 13

WMIC How to pass arguments/ parameters with exe

I want to call exe from remote system using WMIC direct command. for that I prepare one command here

WMIC /NODE:"RemoteSys" /USER:"domain\username" /PASSWORD:"XXXXXXXXX" PROCESS CREATE "C:\Program Files (x86)\Company\Product\productapp.exe"

But issue here is this productapp.exe is expecting an arguments/ parameters like " -p PlantA "

Question here is How to pass it ?

I tried many alternate ways but all fails like:

WMIC /NODE:"RemoteSys" /USER:"domain\username" /PASSWORD:"XXXXXXXXX" PROCESS CREATE "C:\Program Files (x86)\Company\Product\productapp.exe" -p PlantB
Output: Invalid Verb Switch

WMIC /NODE:"RemoteSys" /USER:"domain\username" /PASSWORD:"XXXXXXXXX" PROCESS CREATE "C:\Program Files (x86)\Company\Product\productapp.exe" "-p PlantB" Output: Invalid format. Hint: = [, ].

Don't know what is paramlist & How to use that.

Can anyone help me here ?

Upvotes: 0

Views: 6933

Answers (1)

RudyS
RudyS

Reputation: 94

I've had to do something similar with MATLAB. What you could try is opening a command prompt and executing the program with parameters from that command prompt.

WMIC /NODE:"RemoteSys" /USER:"username" /PASSWORD:"XXX" PROCESS CALL CREATE "cmd.exe /c cd C:/Program Files (x86)/Company/Product/ & productapp.exe -p PlantB" 

Upvotes: 0

Related Questions