Using Process.Start with command line parameters

G

Guest

I have an app that calls an eternal EXE using process.start. My issue is I
have a couple command line parameters that need to be put in, so that it
would read:

Process p = new Process();
p.EnableRaisingEvents = false;
p.StartInfo.WorkingDirectory = "C:\\AutoPM\\AutoD\\"; //**TESTING
p.StartInfo.CreateNoWindow = false;
p.StartInfo.WindowStyle = ProcessWindowStyle.Minimized;

ProcessStartInfo startInfo = new ProcessStartInfo("AutoDim.exe", "
delay=60");
System.Diagnostics.Process.Start(startInfo);

Where the delay=60 is the command line param values.

Anyone have any ideas or assistance? Thanks
 
B

Ben Voigt

Rob said:
I have an app that calls an eternal EXE using process.start. My issue is I
have a couple command line parameters that need to be put in, so that it
would read:

Process p = new Process();
p.EnableRaisingEvents = false;
p.StartInfo.WorkingDirectory = "C:\\AutoPM\\AutoD\\"; //**TESTING
p.StartInfo.CreateNoWindow = false;
p.StartInfo.WindowStyle = ProcessWindowStyle.Minimized;

ProcessStartInfo startInfo = new ProcessStartInfo("AutoDim.exe", "
delay=60");

now you have two ProcessStartInfo objects/structures: p.StartInfo and
startInfo. Maybe you meant to set startInfo.WorkingDirectory, etc?
 

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