Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IIS Restart Script...

Status
Not open for further replies.

devendrap

Programmer
Aug 22, 2001
50
US
I have following ASP page to restart IIS web server.

<%
Dim ows
Dim ret
set oWS=server.createobject(&quot;WScript.shell&quot;)
ret=oWS.Run(&quot;F:\wrestart.bat&quot;)
if(ret<>0) then
response.write(&quot;error <br>&quot;)
end if
%>

The wrestart.bat file is working fine. But when I try to execute the wrestart.bat file thru ASP. It is not working.
I believe the problem is once you stop the web server, the ASP will not able to execute next command.

I would appreciate your help if you have any work around.

Thanks,
Dave
 
Hi, That is the problem..IIS is needed to interpret ASP, so
no IIS, no asp ( It would be like trying to use a video tape to turn on a VCR)....

Use a Windows batch file to restart the IIS - or set it to automatically restart after a failure..

[profile]
 
The Windows command to reset IIS is

iisreset

If you do use a Windows batch file, just call that command and it will stop and restart IIS Services.

It's documented to work with IIS 6.0, and I use perfectly fine with IIS 5.0.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top