Milla
Milla

Reputation: 63

How to start a remote machine process that requires Command Line Arguments with WMI component

I am planning to use WMI to start a process on a remote machine(say batch process). But the process was designed to start with Command Line Argument (say Batch_Type_Code). I couldn't find any sample that uses command line arguments.

Upvotes: 4

Views: 3889

Answers (1)

Mitch
Mitch

Reputation: 22251

According to the documentation for Win32_Process.Create, the command line argument includes both the path to the executable and the arguments:

Create("\"%SYSTEMROOT%\\system32\\cmd.exe\" /K \"echo multiple spaces here\"", null, null, null);

Upvotes: 9

Related Questions