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
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: I hope this is of use for anyone, it was (and I'm sure it will always be) for me.
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?)./RESTART Stops and starts IIS /START Starts IIS (if stopped) /STOP Stops IIS (if started) /REBOOT Reboots the PC /REBOOTONERROR Reboots the PC if it fails to stop IIS without forcing it /NOFORCE Do not force it to stop /TIMEOUT:X After 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.
Loading Comments ...
Comments
No comments have been added for this post.
You must be logged in to make a comment.