Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
IISExpress runner
// Runs IIS Express without a console window (if started with wscript.exe)
var sitePort = 8080
var sitePath = "."
var siteClr = "v4.0"
var fso = new ActiveXObject("Scripting.FileSystemObject");
var wshell = new ActiveXObject("WScript.Shell")
// Resolve path
sitePath = fso.GetAbsolutePathName(sitePath);
// look for IISExpress
var iisexpress = wshell.ExpandEnvironmentStrings("%ProgramFiles%\\IIS Express\\iisexpress.exe");
if (!fso.FileExists(iisexpress)) {
iisexpress = wshell.ExpandEnvironmentStrings("%ProgramFiles(x86)%\\IIS Express\\iisexpress.exe");
if (!fso.FileExists(iisexpress)) {
WScript.Echo("Couldn't find IIS Express. Install using the Web Platform Installer.");
WScript.Quit(1);
}
}
// launch browser
wshell.Run('http://localhost:' + sitePort, 1, false);
// start IISExpress hidden and wait for exit
wshell.Run('"' + iisexpress + '" /port:' + sitePort + ' /clr:' + siteClr + ' /path:"' + sitePath + '"', 0, true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.