Skip to content

Instantly share code, notes, and snippets.

@aplocher
Last active Aug 29, 2015
Embed
What would you like to do?
Starts the ASP.NET Website Admin Tool (WSAT) and launches a web browser to it. WSAT is no longer a prominent feature in VS2013 - this BAT file will assist with easily launching it with a single command.
@echo off
:: Begin config section
set pathToApp=C:\SourceCode\MyApp\MyApp.Web
set pathToIISExpress=C:\Program Files\IIS Express\iisexpress.exe
set webPort=8019
:: End config section
if not exist %pathToApp% (goto errMissingApp)
if not exist %pathToIISExpress% (goto errMissingIisExpress)
call :startWebServer
echo.
call :startWebBrowser
goto success
:errMissingApp
echo ERROR
echo Application not found in the specified path: %pathToApp%
echo.
pause
echo.
goto eof
:errMissingIisExpress
echo ERROR
echo IISExpress.exe not found in specified location: %pathToIISExpress%
echo.
pause
echo.
goto eof
:success
echo SUCCESS
echo.
timeout /t 2 /nobreak >nul 2>&1
echo.
pause
goto eof
:: Helper functions
:startWebServer
start cmd "/t:0F /k echo ** LEAVE THIS WINDOW OPEN UNTIL YOU ARE DONE (PRESS 'Q' TO QUIT) ** &echo. &echo. &"%pathToIISExpress%" /path:c:\windows\Microsoft.NET\Framework\v4.0.30319\ASP.NETWebAdminFiles /vpath:"/asp.netwebadminfiles" /port:%webPort% /clr:4.0 /ntlm"
echo.
echo Please wait...
timeout /t 2 /nobreak >nul 2>&1
goto :eof
:startWebBrowser
echo Starting web browser...
start http://localhost:%webPort%/asp.netwebadminfiles/default.aspx?applicationPhysicalPath=%pathToApp%\^&applicationUrl=/
goto :eof
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment