Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2008-06-22
1
Medium Priority
?
792 Views
Last Modified: 2008-06-29
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

0
Comment
Question by:mdkooo8
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 41

Accepted Solution

by:
graye earned 375 total points
ID: 21896458
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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Progress

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question