Automate Program Execution
What Is Windows Task Scheduler?
Restart an IIS Application Every 5 Minutes
Step 1: Create the Batch Script
#restart_iis_app.bat
@echo off
powershell -Command "Restart-WebAppPool -Name 'MyWebApp'"
# You can also restart the entire IIS site using:
@echo off
powershell -Command "Restart-WebItem 'IIS:\Sites\MyWebApp'"
# Or use appcmd.exe (older systems):
@echo off
%windir%\system32\inetsrv\appcmd stop site /site.name:"MyWebApp"
%windir%\system32\inetsrv\appcmd start site /site.name:"MyWebApp"Step 2: Create the Task in Task Scheduler
What This Does
Confirm It Works
REFERENCES
Last updated