Solved
Command execution
Posted on 2013-01-09
Hi,
I am having the following command which needs to be execute through the .net application
C:\Windows\System32\inetsrv> appcmd set app "Default Web Site/TestTwo" /applicationPool:"Classic.NetAppPool"
I used the above command as follows
protected void Button1_Click(object sender, EventArgs e)
{
string command = string.Format(@"/C C:\Windows\System32\inetsrv> appcmd set app "Default Web Site/TestTwo" /applicationPool:"Classic.NetAppPool");
ProcessStartInfo cmdsi = new ProcessStartInfo("cmd.exe");
cmdsi.Arguments = command; Process cmd = Process.Start(cmdsi);
}
but it is not working, can you guide what went wrong.