2

Is it possible to restart IIS7 using C#? If so, how?

1
  • I'm curious, why do you want this? Commented Aug 22, 2009 at 10:42

2 Answers 2

9
System.Diagnostics.Process.Start(@"C:\windows\system32\iisreset.exe");

should do the trick :)

Dan

Sign up to request clarification or add additional context in comments.

2 Comments

Probably should use environment variable for windows path though :)
If i have a list of servers i want to execute how can i do that
2

Just execute the command-line option using System.Diagnostics.Process.Start();

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.