Search Tools Links Login

Kill IIS process without rebooting


Ever had to restart IIS when it was caught up in a loop, or doing some other stuff which results in IIS not coming down. Service manager fails to stop the www service, task manager gets the "Permission denied error". Only way out is a reboot? Not true!

Original Author: Networking.be

Code


Killing IIS



We've probably all been in an endless-loop situation, or in a situation where your dll called from ASP hangs (every used a msgbox in a dll?).

Bottom line, we need to restart the IIS services. However, because the process is still active, the service manager isn't able to shut it down. When trying to forcefully kill the inetinfo.exe process, or the DLLHOST.EXE process your dll is running in, we get a permission denied error, even when doing this as an administrator. In this case, you probably ended up rebooting the machine...

However, you don't need to. There's a tool from Microsoft, which is installed when installing IIS. It is called iisreset, and can be found in the winntsystem32 folder. This can be run from the command line, and takes a few parameters. The most important are:









/RESTARTStops and starts IIS
/STARTStarts IIS (if stopped)
/STOPStops IIS (if started)
/REBOOTReboots the PC
/REBOOTONERRORReboots the PC if it fails to stop IIS without forcing it
/NOFORCEDo not force it to stop
/TIMEOUT:XAfter X seconds, IIS is forced to stop, unless /NOFORCE was given. If /REBOOTONERROR was given, this will reboot the system.


This can save you a lot of time, since you don't have to reboot the entire system. Very usefull in systems that have a high load, since downtimes are shorter.

I hope this is of use for anyone, it was (and I'm sure it will always be) for me.

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 87 times

Categories

ASP/ HTML

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.