how to hide the console when using Management class "win32_process" to start another proceess?

hi i use the code below to start a batch file process asynchronously.  the method worksk great and doesn't ever hang (like the C# Process.Start does sometimes).  but i can't figure out how to hide the console window that pops up when the batch script begins to execute.  i had more control using the C# Process class but like i said i couldn't get it to stop hanging on one of the scripts i was trying to run.
ManagementClass processClass =
				new ManagementClass("Win32_Process");
 
			object[] methodArgs = {sScriptToExecute + " " + sScriptParams, null, null, 0 };
			int pid = (int)methodArgs[3];
 
			object result =
				processClass.InvokeMethod(
				"Create", methodArgs);

Open in new window

mdkooo8Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
grayeConnect With a Mentor Commented:
You can control the window via the SH_Hide attribute of the Win32_ProcessStart class

http://msdn.microsoft.com/en-us/library/aa394375(VS.85).aspx
0
All Courses

From novice to tech pro — start learning today.