Note – in this program file “before-iis-install-stop.bat” & “after-iis-install-start.bat” & index.html is in same directory.
Step 1 – Write before-iis-install-stop.bat
@echo off
REM - File: before-iis-install-stop.bat
echo Restarting IIS...
echo ======================================================
net stop W3SVC
echo ======================================================
echo IIS StoppedCode language: PHP (php)
Step 2 -Write after-iis-install-start.bat
@echo off
REM - File: after-iis-install-start.bat
echo Restarting IIS...
echo ======================================================
net start W3SVC
echo ======================================================
echo IIS RestartedCode language: PHP (php)
Step 3 – Write appspec.yml
version: 0.0
os: windows
files:
- source: \index.html
destination: c:\inetpub\wwwroot
hooks:
BeforeInstall:
- location: \before-iis-install-stop.bat
timeout: 900
AfterInstall:
- location: \after-iis-install-start.bat
timeout: 180Code language: CSS (css)
I’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms.
I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.
Find Trusted Cardiac Hospitals
Compare heart hospitals by city and services โ all in one place.
Explore Hospitals