How to throw an executable without throwing a dos windows

  • Thread starter Thread starter namri
  • Start date Start date
N

namri

HI
I have a tool "cabarc" to compress File
when I do
Process. Start("cabarc", " n "
+ "A:\\test.txt"+" "C:\\test.txt");
the Probleme: I have a dos windows who appear
How can I do it whithout throwing a dos windows
Thans
 
Hi Namri,

I had the same problem, I solved it creating a pif file and also by
setting ProcessStartInfo in the Process.Start() method.

In the Pif file select "Close on exit" checkbox and minimized in the Run
box, the pif is created under your windows directory.

The properties of ProcessStartInfo that you need to set are:
ProcessStartInfo.WindowStyle = ProcessWindowStyle.Hidden ( if this does not
work try Minimized )

Hope this help,
 
Hi again,

This is the actual code I'm using. I'm using it to run the foxpro 2.5
interpreter.

Hope this help,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

try

{

Process proc = new Process();

proc.StartInfo.FileName = foxexe;

proc.StartInfo.Arguments = prg;

proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;

proc.StartInfo.ErrorDialog = false;

proc.StartInfo.WorkingDirectory = Path.GetDirectoryName( prg);

proc.Start();

proc.WaitForExit();

if ( proc.ExitCode!= 0 )

throw new Exception("Error executing foxpro");

}

catch( Exception ex)
 
Back
Top