Start Development IIS Express Server (tested on Win7 and Win10 with mapped network drives)
@echo off
REM Script will start IIS Express on the specific port with the folder FROM WHICH SCRIPT IS CALLEDREM REM IIS Express does the following:REM * Copies default applicationhost.config file ("C:\Program Files\IIS Express\AppServer\applicationhost.config") to %TEMP%\IISEXPRESS\APPLICATIONHOST{TimeStampGoesHere}.CONFIG (where timestamp is current date+time with milliseconds)REM * The copied config file is modified to specify the physical path (<application ...> --> <virtualDirectory ...> physicalPath property) and the port (<bindings> -> <binding ...> bindingInformation property) REM * Path to custom configuration file can also be provided in the command line using /config:{FullPathToIISApplicationHostCustomConfigFile}setiisexpress_loc="C:\Program Files\IIS Express\iisexpress.exe"setfolder_loc=%cd%setport_loc=2018
if [%1]==[--help] gotosyntaxif [%1]==[/?] gotosyntaxif [%1]==[] gotoproceedsetport_loc=%1:proceedecho.
echo Make "%folder_loc%" accessible from "http://localhost:%port_loc%" ...
echo.
%iisexpress_loc% /path:"%folder_loc%" /port:%port_loc% /trace:w /systray:true
gotoexit:syntaxecho.
echo Syntax: %0 PortNumberGoesHere
echo Default Port: %port_loc%echo.
gotoexit:exitecho.
echo.
echo.
pause