Created
March 10, 2011 15:16
-
-
Save duncansmart/864232 to your computer and use it in GitHub Desktop.
IISExpress runner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: Runs IIS Express and exits. IIS Express is kept alive by WScript.exe | |
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | |
:: NOTE, these are ignored if a file called IISExpress.config exists | |
set SITE_PORT=8080 | |
set SITE_PATH=%~dp0 | |
set SITE_CLR=v4.0 | |
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | |
set IISEXPRESS=%ProgramFiles%\IIS Express\iisexpress.exe | |
if not exist "%IISEXPRESS%" set IISEXPRESS=%ProgramFiles(x86)%\IIS Express\iisexpress.exe | |
if not exist "%IISEXPRESS%" ( | |
echo Could not find IIS Express. Please install using Web Platform Installer. | |
pause | |
exit | |
) | |
:: Trim any trailing slash. The /path switch doesn't like it | |
if %SITE_PATH:~-1% == \ set SITE_PATH=%SITE_PATH:~0,-1% | |
set VBSFILE="%TEMP%\iisexpressrun-%SITE_PORT%.vbs" | |
echo CreateObject("WScript.Shell").Run """%IISEXPRESS%"" /port:%SITE_PORT% /clr:%SITE_CLR% /path:""%SITE_PATH%"" ", 0, True > %VBSFILE% | |
start wscript.exe %VBSFILE% | |
start http://localhost:%SITE_PORT%/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment