Click to See Complete Forum and Search --> : How to pass Arguments to command prompt of Visual studio 2005 from a window applic..


sinoljose
August 30th, 2008, 02:18 AM
i need to execute from a window application the command csc HelloWorld.cs

i tried like this........
System.Diagnostics.Process p= new System.Diagnostics.Process();

p.StartInfo.FileName = "Visual Studio 2005 Command Prompt";

/// here i got the command prompt for visual studio 2005"....

now i need to pass the arguments... HOW it should be ,,,,,,
i tried like this... but ERROR

p.StartInfo.Arguments = "csc HelloWorld.cs";

at this point i got thr Error as shown below:

Error in script usage. The correct usage is:
"C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat" [option]
where [option] is: x86 | ia64 | amd64 | x86_amd64 | x86_ia64

For example:
"C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat" x86_ia64

C:\Program Files\Microsoft Visual Studio 8\VC>

eclipsed4utoo
August 30th, 2008, 10:15 AM
Process.Start("cmd", "/C COPY "C:\Test.txt" "C:\Test\Test.txt");


the "/C" argument tells the command prompt what commands to run after it opens.