I can't seem to find an answer on Google or here on StackOverflow.
How can I start a process in background (behind the active window)? Like, when the process starts, it will not interrupt the current application the user is using.
The process won't pop out in front of the current application, it will just start.
This is what I'm using:
Process.Start(Chrome.exe);
Chrome pops up in front of my application when it's started. How can I make it start in background?
I've also tried:
psi = new ProcessStartInfo ("Chrome.exe");
psi.UseShellExecute = true;
psi.WindowStyle = ProcessWindowStyle.Hidden;
psi.WindowStyle = ProcessWindowStyle.Minimized;
Process.Start(psi);
But there's no difference at all from the previous one.
Thanks.
If you know you want to run a command in the background, type an ampersand (&) after the command as shown in the following example. The number that follows is the process id. The command bigjob will now run in the background, and you can continue to type other commands.
Use bg to Send Running Commands to the Background Hitting Ctrl + Z stops the running process, and bg takes it to the background. You can view a list of all background tasks by typing jobs in the terminal.
Running shell command or script in background using nohup command. Another way you can run a command in the background is using the nohup command. The nohup command, short for no hang up, is a command that keeps a process running even after exiting the shell.
A background process is a computer process that runs behind the scenes (i.e., in the background) and without user intervention. Typical tasks for these processes include logging, system monitoring, scheduling, and user notification.
Try this:
Process p = new Process();
p.StartInfo = new ProcessStartInfo("Chrome.exe");
p.StartInfo.WorkingDirectory = @"C:\Program Files\Chrome";
p.StartInfo.CreateNoWindow = true;
p.Start();
Also, if that doesn't work, try adding
p.StartInfo.UseShellExecute = false;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With