Friday, January 22, 2010

ASP JScript for restarting IIS

<script language="JScript" runat="server">
try{
  var fullPath = "IIS://localhost/W3svc/1",
  oServer = GetObject(fullPath);
  Response.write("Restarting web server in progress.
"); Response.write(" Please connect later!"); oServer.Stop(); oServer.Start(); }catch(e){ Response.write("Can't stop web server"); } </script>

No comments: