|
|
Terms of Agreement:
By using this article, you agree to the following terms...
1) You may use
this article in your own programs (and may compile it into a program and distribute it in compiled format for langauges that allow it) freely and with no charge.
2) You MAY NOT redistribute this article (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.
3) You may link to this article from another website, but ONLY if it is not wrapped in a frame.
4) You will abide by any additional copyright restrictions which the author may have placed in the article or article's description. | 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 winnt\system32 folder. This can be run from the command line, and takes a few parameters. The most important are:
/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.
I hope this is of use for anyone, it was (and I'm sure it will always be) for me. | |
Other 11 submission(s) by this author
|
|
|
Report Bad Submission |
|
|
Your Vote! |
See Voting Log |
|
Other User Comments |
4/11/2002 2:28:00 AM:Cesare Man, I was looking for this.
Have I
ever told you that you're really GREAT
?!?
Have a nive day, you LampedGuru
//:wink
Cesare Imperiali
|
4/11/2002 3:42:52 AM:Cakkie Cesare, have you ever ... never mind
:wink
|
4/11/2002 7:28:06 AM:Joshua Now, if only this little trick worked
for NT4....
This only works for
Win2000.
|
4/11/2002 1:03:59 PM:Cakkie Well, this can be done using NET STOP
on NT. I don't know the exact syntax
however.
|
4/13/2002 12:27:46 PM:Pingo Excellent!
I have to restart IIS very
often due to some problems,
so this is
really very useful for me.
Thanks.
|
4/24/2002 5:28:20 AM:Mike Cool, I didn't know about this. I
always used NET STOP but somtimes it
takes a long time or doesn't stop the
process correctly. I'll give this one
a shot the next time dllhost.exe maxes
out.
|
5/3/2002 1:01:39 PM:Marc use this on NT4/IIS4:
net stop
iisadmin /y
mtxstop
net start w3svc
(also works on w2k but iisreset is
prefered)
|
|
Add Your Feedback! |
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.
NOTICE: The author of this article has been kind enough to share it with you. If you have a criticism, please state it politely or it will be deleted.
For feedback not related to this particular article, please click here. |
|