Link to home
Start Free TrialLog in
Avatar of praveen1981
praveen1981Flag for India

asked on

Command execution

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.
ASKER CERTIFIED SOLUTION
Avatar of Kyle Abrahams, PMP
Kyle Abrahams, PMP
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of praveen1981

ASKER

Thanks a lot for your solution