EDN Admin
Well-known member
Hello,
Even though this is a Windows Form, I feel this question belongs here, if I am wrong - my apologies!
I am writing an app to use a Windows Form to modify a .config file related to IIS Express. No matter how I attempt to pass a command line to the Command Window, I cannot get it to pass. The window opens to the Visual Studio debug directory and stays there, and my CD command does not generated or shown. Basically all I am trying to do is run a CD command to get to the IIS Express directory, then I will run the APPCMD command with the appropriate switches. Thank you for any help!
Relevent code: string strCmdText;
strCmdText = ShellCommand.ToString();
System.Diagnostics.Process process = new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal;
startInfo.FileName = @"C:WindowsSysWOW64cmd.exe";
startInfo.Arguments = @"/C /cd crogram files (x86)IIS Express";
//startInfo.Arguments = "/C " + strCmdText;
process.StartInfo = startInfo;
//Process.Start();
Process.Start("CMD.exe", @"cd crogram files (x86)IIS Express");
View the full article
Even though this is a Windows Form, I feel this question belongs here, if I am wrong - my apologies!
I am writing an app to use a Windows Form to modify a .config file related to IIS Express. No matter how I attempt to pass a command line to the Command Window, I cannot get it to pass. The window opens to the Visual Studio debug directory and stays there, and my CD command does not generated or shown. Basically all I am trying to do is run a CD command to get to the IIS Express directory, then I will run the APPCMD command with the appropriate switches. Thank you for any help!
Relevent code: string strCmdText;
strCmdText = ShellCommand.ToString();
System.Diagnostics.Process process = new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal;
startInfo.FileName = @"C:WindowsSysWOW64cmd.exe";
startInfo.Arguments = @"/C /cd crogram files (x86)IIS Express";
//startInfo.Arguments = "/C " + strCmdText;
process.StartInfo = startInfo;
//Process.Start();
Process.Start("CMD.exe", @"cd crogram files (x86)IIS Express");
View the full article