I want to run cmd in a asp.net application. Here is my code:
System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo.FileName = "cmd";
process.StartInfo.Arguments = "cd C:\\";
process.Start();
The program starts the cmd.exe but instead of “C:>” I see this:
C:\program Files\Common Files\Microsoft Shared\Devserver\10.0>
Could somebody tell me what i do wrong in the code? Thanks in advance!
The
Argumentsare used as the parameters to the application being called, therefore it’s the same as havingcmd "cd c:\"in your Run prompt under the Start Menu.In this instance, what I think you want is the following (instead of the
Argumentsline)…