System.Diagnostics.Process() help

Hi everyone, small problem with the use of System.Diagnostics.Process() method.


I am using the software OmniPeek and well it can be run via the command prompt to start up and autorun and do what I need it to do; I also have a few other pieces of software I want to run along with it.

Long story short, I don't want have to constantly go into the cmd promt to do this, so I tried writing a lil widget. The code I wrote however, does not work, it just opens the program and doesn't execute the commands with it.

Here is the code

[code]
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.EnableRaisingEvents = false;
proc.StartInfo.FileName = "C:\\Program Files\\WildPackets\\OmniPeek\\OPeek.exe";
proc.StartInfo.Arguments = "/autostart";
proc.Start();
[/code]

Any help, suggestions?

[934 byte] By [BryanKardisco] at [2007-12-21]
# 1

I'm not sure what going wrong there, but try to simplier:

Process.Start("C:\\Program Files\\WildPackets\\OmniPeek\\OPeek.exe", "/autostart");

JamesCurran at 2007-9-10 > top of Msdn Tech,Visual C#,Visual C# Language...
# 2
I took a different approach to it and got it to work

Here it is


[code]
System.Diagnostics.Process foo = new System.Diagnostics.Process();
foo.StartInfo.FileName = "cmd.exe";
foo.StartInfo.WorkingDirectory = "C:\\Program Files\\WildPackets\\OmniPeek\\";
foo.StartInfo.Arguments = "/c OPeek.exe /autostart /autoload Chan_1.ctf Chan_6.ctf";
foo.Start();
[/code]

BryanKardisco at 2007-9-10 > top of Msdn Tech,Visual C#,Visual C# Language...