2

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

YeahStu
  • 3,982
  • 5
  • 44
  • 67
Alex
  • 73,729
  • 83
  • 253
  • 341

2 Answers2

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

should do the trick :)

Dan

Daniel Elliott
  • 22,229
  • 10
  • 62
  • 82
2

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

Rick Hoving
  • 3,527
  • 3
  • 28
  • 48
Henri
  • 5,045
  • 19
  • 24