In order to reset IIS using batch file, please follow the below steps.
1. Create a text file, RestartIIS.bat
2. modify the text file and add this script to it.
3. save the batch file, and double click to run it.
4. If it runs, please remove pause and you can use this batch file in a schedule task to have it scheduled to run in a timely manner.
5. If it does not run, and waiting for additional permissions, please create a shortcut for this batch file in the same location.
6. Open the properties of this shortcut file, rightclick -> Properties -> ShortCut tab
7. Click on the Advanced… button and select Run as administrator. Click OK to close this window. Apply and OK again.
8. Run the BatchFile again, it should work this time.
If you have any questions, please mention them in the comments area. Thank you for reading this article.