简体   繁体   中英

Start hidden process C#

Code:

System.Diagnostics.Process.Start("rundll32.exe", "InetCpl.cpl,ClearMyTracksByProcess 4351");

I want start it hidden, how I can do it?

You could set the WindowStyle property to Hidden like this:

ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = "rundll32.exe";
startInfo.UseShellExecute = false;
startInfo.RedirectStandardOutput = true;
 startInfo.WindowStyle = ProcessWindowStyle.Hidden;
 //Start the process
 Process proc = Process.Start(startInfo);

Goodluck.

one can do like the code below:

 ProcessStartInfo psi = new ProcessStartInfo();
 psi.FileName = ....
 psi.RedirectStandardInput = true;
 psi.RedirectStandardOutput = false;
 psi.Arguments =...
 psi.UseShellExecute = false;
 psi.CreateNoWindow = true; // <- key line

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM