I need to start a Visual Basic script file by using WMI in a c# code.
I don't quite understand what is wrong with this piece of code? Result will be always 8 (Unknown failure). But for example notepad.exe can be started without failure.
//Get the object on which the method will be invoked
ManagementClass processClass = new ManagementClass("Win32_Process");
//Create an array containing all arguments for the method
object[] methodArgs = { "C:\\MyFolder\\Test.vbs arg1 arg2", null, null, 0 };
//Execute the method
object result = processClass.InvokeMethod("Create", methodArgs);