Start 'invisible' process

  • Thread starter Thread starter tcomer
  • Start date Start date
T

tcomer

Is there any Process options that will allow a DOS application to
execute without showing the cmd window? My application uses a small
DOS application to retrieve a list of machines, but I don't want the
window to pop up while this is happening, I want it to be an
"invisible" process. Is there any way to do this?

I've googled, and have come up with many options, to no avail. I've
tried creating a batch file with the appropriate switches, but doesn't
seem to turn out the way it should. Any ideas? Thanks
 
tcomer,

I am not sure anymore, I thought it was this one, if not try another one it
is for sure there.

TheProcessStartObject.UseShellExecute = false;

Cor
 
Hi,

Take a look at either Process or ProcessStartInfo classes, one of them
provide a property for it.

Ok, I did the search :) It.s ProcessStartInfo.WindowStyle the oe that does
the trick
 
Sorry for the late response, box crashed. I will try both of your
suggestion and post and update, thanks a lot for the help!; always
appreciated
 
Thanks for all of the help! The following code executes a command-line
based application in 'invisible' mode. The DOS window isn't shown upon
execution. Again, the help is very much appreciated. Sorry for the
redundant question.

Process proc = new Process();

// Run in 'invisible' mode
proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
proc.StartInfo.FileName = path + "\\" + FILENAME;
proc.StartInfo.Arguments = CMD_PARAMS; // commandline params
proc.Start();
 
Back
Top