2

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

YeahStu
  • 4,032
  • 5
  • 48
  • 69
Alex
  • 75,813
  • 86
  • 255
  • 348

2 Answers2

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

should do the trick :)

Dan

Daniel Elliott
  • 22,647
  • 10
  • 64
  • 82
2

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

Rick Hoving
  • 3,585
  • 3
  • 29
  • 49
Henri
  • 5,065
  • 23
  • 24