I m executing a remote CMD line command via WMIC that takes a few seconds to run. I m currently doing Thread.Sleep(4000) before moving on...there MUST be a better way! Is there a variable or method I can use to determine if the command I issued finished / a status byte?
Thanks!
Im using the following code to issue the commands:
ManagementClass processTask = new ManagementClass(@"\" + this.wmiConnection.machineName + @"
ootCIMV2", "Win32_Process", null);
ManagementBaseObject methodParams = processTask.GetMethodParameters("Create");
methodParams["CommandLine"] = command;
methodParams["CurrentDirectory"] = @"C:";
Just need to figure out how to determine when the command finishes :). Thanks!