Tuesday 8 September 2020

Avoid IISRESET command, restart only relevant APP with SINGLE command

Hope you all doing great, 

I believe we all are using IISRESET after local/staging environment publish activity which earlier mentioned that to avoid IISRESET but I was also not following.



Major concern not to use IISRESET because it restart all the hosted applications on IIS, which should not happen.

Think about a scenario where 5 teams are using same development environment for different application.


To know more in deep - why to Avoid IISRESET?


In this article come up with the solution with single line command to avoid IISRESET. Hope this will save time to everyone.

First i will suggest to make below path globally accessible and this is one time activity

right click on This PC and select properties

From the left side click on Advanced System Settings

Click on Environment Variables and then from System variables section select Path as below 

then click on New and add below path

C:\Windows\System32\inetsrv 


now press OK OK OK


Now let's run one line command as mentioned steps, Please follow


  • press win + R
  • now paste below command (replace YourSitecoreName with your application name)

"C:\Windows\System32\cmd.exe" /c appcmd.exe  stop site /site.name:"YourSiteName" && appcmd.exe  start site /site.name:"YourSiteName"


  • Now press CTRL+SHIFT+ENTER (used to run command as admin)

once it works successfully, in future just run command as above steps only with single line command.


Hope this will and help and save time.
Please comment, if find any better approach.