I have a windows application hosted on web server and a exe placed in D drive in another server. Now i want to run that exe from my web server on button click using WMI DLL. Also, I need to pass some arguments.???
I am able to open the notepad in remote computer but not able to run the exe.
string processPath = "path of exe";
var processToRun = new[] { processPath };
var connection = new ConnectionOptions();
connection.Username =
connection.Password =
var wmiScope = new ManagementScope(String.Format("\\\\{0}\\root\\cimv2", "Server Name"), connection);
var wmiProcess = new ManagementClass(wmiScope, new ManagementPath("Win32_Process"), new ObjectGetOptions());
var result = wmiProcess.InvokeMethod("Create", processToRun);