How To Recycle IIS Application Pool Manually via DOS Command ?

As a .NET programmer and an avid user of the Global Assembly Cache when dealing with SharePoint one of the things that I have to use most to test my solutions is to recycle the application pool, so that I can put my newly created DLLs and test them.
I use a lot WSPBuilder for this task, but I always wondered : How can I recycle the application pool via command prompt ?
In case you ever wonder the same and still don’t know how to do it, here’s how:
the cscript command is pretty neat. And mostly the Microsoft Platform applications have a .vbs file assigned to them, so give it a try and try some other cool stuff in other apps.
See you later,



  1. Also:
    appcmd recycle apppool "MySharepointAppPool"

    appcmd.exe can be found in the \windows\system32\inetsrv\ directory.

  2. WSPBuilder has built in tools to do that application recycle. Should check out the tools on the @SPDevWIki

    Has a link to @harbars application pool recycle tool too!

  3. yes Jeremy, wspb it is indeed a very good tool, but the post was intended to display a 'command line option'.

    mostly the sharepoint people already know the WSPBuilder anyway :)

    thanks for the comment and take a look at @superedge

  4. Edge,

    Thank you very much. It has been years since I have written a batch job so that I can schedule a task. We are on IIS 6.0 and your little cscript example made it a breeze, for someone who doesn't have a lot of other tools handy, to create a scheduled IIS Recycle Default Application Pool batch file.

  5. I am glad if found it helpful :)