Here is a quick and simple script to allow you to start and stop an IIS app pool. I’ve used it with Windows Server 2003 and 2008. I’ve named the file AppPool.vbs, and saved it in my Windows folder (any folder in your path would be fine).

Set ArgObj = WScript.Arguments
Set objIIS = GetObject("IIS://LocalHost/W3SVC/AppPools/" & ArgObj(1))
If ArgObj(0) = "start" then
objIIS.Start
Else
objIIS.Stop
End if

It is executed by using the following commands

AppCode start [application pool name]
AppCode stop [application pool name]

Tags: , , ,