Start a DOS-Process shows no output

G

GT

Hello

C#-winform application starts a DOS-EXE which is a ARJSFX.
Everything is working fine, but the output from the EXE is not shown in the
dosbox (something like extracting...).

I konow i could redirect the output but it would be much simpler to simply
see the normal dosbox-output.

System.Diagnostics.ProcessStartInfo pkw = new
System.Diagnostics.ProcessStartInfo(tmpDir + "some.exe");
pkw.UseShellExecute = true;
pkw.WindowStyle =
System.Diagnostics.ProcessWindowStyle.Normal;
pkw.Verb = "open";
//pkw.Arguments = "/y";
pkw.WorkingDirectory = tmpDir;
System.Diagnostics.Process pr =
System.Diagnostics.Process.Start(pkw);
Application.DoEvents();
pr.WaitForExit(300000);

Thanks for any help
 
F

Family Tree Mike

A couple of things that jump out at me would be:

1. Is tmpDir pointing to the right place?
2. You should not need the pkw.Verb = "open". You are starting an exe.
Open would normally be used to start a default app (unknown) for a PDF file,
for example.
3. your last line is pr.WaitForExit(300000). It should probably be
pkw.WaitForExit(300000).
 
G

GT

Thanks for your reply, but I think you didn´t get the problem, Probably i
didn´t express it clearly. Everything is working fine, the exe is executing
and doing it´s work but it doens't show any output in the dosbox, which you
can see when you start it maually (Extracting file1....)

Probably you're right pkw.Verb = "open" is not necessary since it´s an EXE,
but it doesnt change anything to take it out. workdir is pointing at the
right directory
and pr.WaitForExit(300000) is correct, since it is the process started by
ProcessStartInfo pkw. ProcessStartInfo doens't have a method WaitForExit().
 
G

GT

The problem is solved, the solution was to call cmd.exe with the other exe as
parameter. Maybe someone else can need this hint!
 

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