Solved

Command execution

Posted on 2013-01-09
2
192 Views
Last Modified: 2013-01-10
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.
0
Comment
Question by:praveen1981
2 Comments
 
LVL 39

Accepted Solution

by:
Kyle Abrahams earned 500 total points
Comment Utility
0
 

Author Closing Comment

by:praveen1981
Comment Utility
Thanks a lot for your solution
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now