How to throw an executable without throwing a dos windows

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
 
I

Ignacio Machin

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,
 
I

Ignacio Machin

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top