If you’re an ASP.NET developer, you may sometimes find you need to recycle your application’s app pool. You might be used to hunting down the application pool in IIS Admin, right-clicking on the pool and selecting ‘recycle’. This can be a big pain when dealing with a lot of servers.

There is a little-known way to automate this in a command line, though.

Put the following in a batch file and enjoy:


@REM Recycle the app pool
cscript c:\WINDOWS\system32\iisapp.vbs /a SuperDuperAppPool /r
@pause

Where ‘SuperDuperAppPool’ is the application pool name you’d like to recycle.