We have two options to Start, Stop to Restart IIS service on windows. You can do it directly from the Windows services center or you can do it directly via the command line.
To do this you must have Administrative access to your system. Open Windows command prompt “run as Administrator” and follow the below instructions.
If you are directly logged in with the Administrator account you can run the same commands through run Window in your Windows system.
1. Start IIS via Command Line
Use following command to start IIS service on Windows operating systems. Either use Windows command prompt to run this command or execute it from run window.
To start IIS on command line, Open terminal and type:
c:/> iisreset /start
Press WIN + R
to open Run window. Type the same command on run window and press enter:
2. Stop IIS via Command Line:
Use following command to stop IIS service on Windows operating systems. Either use Windows command prompt to run this command or execute it from run window.
c:/> iisreset /stop
To stop IIS on command line, open terminal and type:
Press WIN + R
to open Run window. Type the same command on run window and press enter:
3. ReStart IIS via Command Line:
Use the following command to restart IIS service on Windows operating systems. Either use the Windows command prompt to run this command or execute it from the run window.
c:/> iisreset /restart [or] c:/> iisreset
Default iisreset command restarts the IIS service. So you don’t need to provide /restart parameter option to iisreset command to restart IIS service.
To restart IIS on command line, open terminal and type:
Press WIN + R
to open Run window. Type the same command on run window and press enter:
6 Comments
Prathima (or anyone curious about the same), hope you’ve gotten your answer by now.
But if not…
You’ll need to write a small script that runs the iisreset command. Just a quick line or two like this will work:
@echo off
c:\Windows\system32\iisreset.exe /restart
Another script could check on the status of the web server periodically, seeking a specific page. You can even target one that’s not publicly linked, such as
/TellMeWhenThisSiteIsDown.html
Put the web check script in your Task Scheduler. Once an hour, every five minutes, whatever. If the page loads properly, the script exits; if it finds errors, it then runs the restart script.
A “quick and dumb” way to do this would be to simply run the restart script each day when you expect no clients (e.g. 3am).
The disadvantage of course is that it would disconnect / log out anyone who happened to be visiting at the time of the restart (INCLUDING other automated processes relying on the web server), which is of course not ideal. But it also can be written, scheduled, and done in two minutes. So for a low-volume site that still needs to remain available… it’s an option.
Your picture under “Stop” and “Start” are backwards (they don’t sync with the text)
How we can stop remotely from other server as a batch or powershell ?
Thanks a lot, it saved my day 🙂
I can’t start my wampp server because it’s IIS service still online.
Hi ,
Can you please help me is there a way to automate this process to perform iisreset when one of the services is down ?
Hello Thanks Post To This Article. Its Working And use to easily..