Sometimes we inadvertently use an infinite loop in WEB programs such as ASP, or hang when testing DLL components. At this time, IIS stopped responding. We need to continue our work and restart the IIS service.
However, this process is still executing and the Internet Service Manager cannot be closed. When we want to end the inetinfo.exe or DLLHOST.EXE process, we get a rejection message. Of course, you will still get this prompt if you have administrator rights. You may also use net stop, but it takes longer and sometimes does not respond.
At this time we only have to restart the computer. Can I RESTART IIS without restarting the computer?
Of course, Microsoft installed a tool called iisreset when installing IIS. You can find it in winntsystem32. It can be used in the command line mode like PING. It has multiple parameters. Here are a few important ones, which are also the parameters that are relevant to our article:
/RESTART starts IIS after stopping.
/START Start IIS (if stopped)
/STOP Stop IIS (if started)
/REBOOT Restart the computer
/REBOOTONERROR If stopping IIS fails, restart the computer
/NOFORCE does not force IIS to stop
/TIMEOUT:X After X seconds, IIS is forced to stop, unless the /NOFORCE parameter is given. If /REBOOTONERROR is given, it restarts the computer.