Running cmd commands via .NET?

Posted by a2h on Stack Overflow See other posts from Stack Overflow or by a2h
Published on 2009-03-27T22:41:12Z Indexed on 2010/03/25 18:43 UTC
Read the original article Hit count: 648

Filed under:
|
|
|
System.Diagnostics.Process proc0 = new System.Diagnostics.Process();
proc0.StartInfo.FileName = "cmd";
proc0.StartInfo.WorkingDirectory = Path.Combine(curpath, "snd");
proc0.StartInfo.Arguments = omgwut;

And now for some background...

string curpath = System.IO.Path.GetDirectoryName(Application.ExecutablePath);

omgwut is something like this:

copy /b t.wav + y.wav + p.wav + e.wav + space.wav + i.wav + n.wav + space.wav + s.wav + o.wav + m.wav + e.wav + space.wav + t.wav + e.wav + x.wav + t.wav + space.wav + h.wav + e.wav + r.wav + e.wav + space.wav + a.wav + n.wav + d.wav + space.wav + p.wav + y.wav + r.wav + o.wav + space.wav + w.wav + i.wav + l.wav + l.wav + space.wav + s.wav + h.wav + o.wav + w.wav + space.wav + h.wav + i.wav + s.wav + space.wav + r.wav + e.wav + n.wav + d.wav + i.wav + t.wav + o.wav + n.wav + space.wav output.wav

And nothing happens at all. So obviously something's wrong. I also tried "copy" as the executable, but that doesn't work.

© Stack Overflow or respective owner

Related posts about c#

Related posts about process