Restart IIS, ASP JScript





1
Date Submitted Fri. Jan. 22nd, 2010 3:42 AM
Revision 1 of 1
Scripter Cloudgen
Tags ASP | JScript | Restart-IIS
Comments 0 comments
This ASP JScript code is designed for restarting IIS. Sufficient right should be grant to the page containning the code. Detail please visitRestarting IIS


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

Comments

There are currently no comments for this snippet.

Voting

Votes Up


Scripter Cloudgen

Votes Down