IIS,Ever,restart,caught,loop,doing,some,other
Quick Search for:  in language:    
IIS,Ever,restart,caught,loop,doing,some,other
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
ASP/ VbScript Stats

 Code: 117,337 lines
 Jobs: 143 postings

 
Sponsored by:

 

You are in:

 
Login


 

 


Latest Code Ticker for ASP/ VbScript.
Click here to see a screenshot of this code!Ultimate Forum 2
By Gurgen Alaverdian on 6/1

(Screen Shot)

Speedy ASP Discussion Forum BBS
By ASPwebServer on 6/1


[[ Learn Database and ASP by Video ]]]
By Brian Link on 5/31


Generic XML Grabber
By Kevin O'Neill on 5/31


Block User to copy Links
By Shahid allauddin on 5/31


Click here to see a screenshot of this code!geographical search
By Igor Krupitsky on 5/31

(Screen Shot)

Click here to see a screenshot of this code!CDF/Active Desktop Example without ASP
By John on 5/30

(Screen Shot)

Click here to see a screenshot of this code!CDF/Active Desktop Example with ASP
By John on 5/30

(Screen Shot)

Date & Time Function
By Marc Ripin on 5/30


Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!





Affiliate Sites



 
 
   

Kill IIS process without rebooting

Print
Email
 

Submitted on: 4/10/2002 7:21:19 AM
By: Cakkie  
Level: Beginner
User Rating: By 6 Users
Compatibility:ASP (Active Server Pages)

Users have accessed this article 1884 times.
 
(About the author)
 
     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!

 
 
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:

/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.


Other 11 submission(s) by this author

 

 
Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
Reason:
 
Your Vote!

What do you think of this article(in the Beginner category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor 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
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/11/2002 3:42:52 AM:Cakkie
Cesare, have you ever ... never mind :wink
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/11/2002 7:28:06 AM:Joshua
Now, if only this little trick worked for NT4.... This only works for Win2000.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
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.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
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.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
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.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
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)
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
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.
 
Name:
Comment:

 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | ASP/ VbScript Home | Site Home | Other Sites | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.  Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.