Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

c#

vb.net

wmi

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.

like image 379
Milla Avatar asked Oct 19 '25 01:10

Milla


1 Answers

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);
like image 87
Mitch Avatar answered Oct 21 '25 14:10

Mitch



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!