To run web and windows services in IIS Express through command prompt or batch file, we can create a batch file with the following changes:
Other Windows services can be started as below:
cd "C:\Program Files (x86)\IIS Express"In applicationhost.config make changes as below:
start iisexpress /config:"path to your project source code repository\.vs\config\applicationhost.config" /site:WebSiteName
- Look for something like below for the WebSiteName above
<sites>
<site name="WebSite1" id="1" serverAutoStart="true">
- Update physicalPath to correct path:
physicalPath="VirtualDirectory of WebSite" />
- or copy all the bin(assembly) files as seen below:
bin=> has all dll's of the web service
Web.config should detail the hosting details of all services.
Other Windows services can be started as below:
- Create a shortcut to the windows service with command line arguments if any.
- In batch file add this line:
- start "Service title" /b "Path of shortcut to windowsservice.exe shortcut"