Executing batch files in C#.
-
I won't go into details, but I would like to start a command line program from a c# form app. What I have been doing is write the file with c# code and execute it. I have been successful in changing the directory (cd ....) in the batch file. What i need now is to have another command called ("make"). I would like to know how to do this with either a batch file line or with something from a FCL class. To better illustrate my problem, here is an example of my programs batch output.
set path=%path%;C:/pspdev/bin // these lines are static, they don't change
set PSPSDK=C:/pspdev/psp/sdk
cmd /k cd C:\pspdev\Projects\HomebewApp // this one changes directory on cmd startup, i tried to repeat the line with the "make" command but it didn't work. -
I won't go into details, but I would like to start a command line program from a c# form app. What I have been doing is write the file with c# code and execute it. I have been successful in changing the directory (cd ....) in the batch file. What i need now is to have another command called ("make"). I would like to know how to do this with either a batch file line or with something from a FCL class. To better illustrate my problem, here is an example of my programs batch output.
set path=%path%;C:/pspdev/bin // these lines are static, they don't change
set PSPSDK=C:/pspdev/psp/sdk
cmd /k cd C:\pspdev\Projects\HomebewApp // this one changes directory on cmd startup, i tried to repeat the line with the "make" command but it didn't work. -
I won't go into details, but I would like to start a command line program from a c# form app. What I have been doing is write the file with c# code and execute it. I have been successful in changing the directory (cd ....) in the batch file. What i need now is to have another command called ("make"). I would like to know how to do this with either a batch file line or with something from a FCL class. To better illustrate my problem, here is an example of my programs batch output.
set path=%path%;C:/pspdev/bin // these lines are static, they don't change
set PSPSDK=C:/pspdev/psp/sdk
cmd /k cd C:\pspdev\Projects\HomebewApp // this one changes directory on cmd startup, i tried to repeat the line with the "make" command but it didn't work.Well, you don't want to do the set commands every time you run the batch file because every time you do, it appends your path change to the system path. You should check the environment variables and make sure you need to do that before doing it. As far as the "cmd" line, you can set the working directory for an app by using the
Process
object..45 ACP - because shooting twice is just silly
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001