executing in a different directory

Jan 18, 2011 at 2:35am
System::Diagnostics::Process::Start("lag.exe");

I love this command, but how do I use it for something in another directory

let's say the .cpp is in
c:\lag

but the file I want is in
c:\lag2
Jan 18, 2011 at 3:20am
you can use spawn and exec functions to run the command and it will help you keep track of it...

other than that, you can just add directories "C:\somedir\lag.exe" or "..\lag.exe"
Jan 18, 2011 at 3:24am
I tried adding the directory. Nothing happened. I didn't get an error, but nothing happened.
Jan 18, 2011 at 3:43am
you didn't put like I did, did you?... don't forget about the '\' they have to be "\\"
Jan 18, 2011 at 8:56pm
Use the following overload of Process.Start:

http://msdn.microsoft.com/en-us/library/0w4h05yb%28v=vs.80%29.aspx

And set the property working directory of the instance of the ProcessStartInfo class:

http://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo.workingdirectory.aspx
Topic archived. No new replies allowed.