Skip to content

Instantly share code, notes, and snippets.

@leekelleher
Last active June 14, 2017 18:44
Show Gist options
  • Save leekelleher/870634 to your computer and use it in GitHub Desktop.
Save leekelleher/870634 to your computer and use it in GitHub Desktop.
Serve any folder in IIS Express
' Serve any folder in IIS Express
' http://blog.mattbrailsford.com/2011/03/14/easily-serve-any-folder-in-iis-express/
' Init randomization
Randomize
' Set random port number
Dim port
port = Int(Rnd() * 8974) + 1025
' Launch IIS Express / Browser
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run """%ProgramFiles%\IIS Express\iisexpress.exe"" /path:""" & WScript.Arguments.Item(0) & """ /port:" & CStr(port) & " /systray:true", 0, False
WshShell.Run "http://localhost:" & CStr(port), 9, False
Set WshShell = Nothing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment