asp.netwindowsvisual-studio-2008visual-studio-2010batch-file

.BAT file that starts ASP.NET Development Server, then opens in browser


I am trying to create a .bat file that starts the ASP.NET Dev Server outside of Visual Studio, and then opens the site in a browser. What I have so far does successfully start the Dev Server, but then it stops there and doesn't open the browser.

Here is what I have in my .bat file:

"C:\Program Files\Common Files\Microsoft Shared\DevServer\9.0\WebDev.WebServer.EXE" /port:4608 /path:"C:\Projects\a_project\Dev\path-to-site" /vpath:"/path-to-site"
start "http://localhost:4608/path-to-site/sitefinity"

Any ideas what is wrong with this? Thanks

UPDATE:

Based upon some of your answers I added the start /B to the first line and now neither the the web server or the browser open. I just get a new empty cmd prompt window. Here is the latest that is not working:

start /B "C:\Program Files\Common Files\Microsoft Shared\DevServer\9.0\WebDev.WebServer.EXE" /port:4608 /path:"C:\Projects\a_project\Dev\path-to-site" /vpath:"/path-to-site"
start "http://localhost:4608/path-to-site/sitefinity"

UPDATE 2:

I figured it out with help from you all and some trial and error. See the final solution below.


Solution

  • The following was the final working script:

    start /D "C:\Program Files\Common Files\Microsoft Shared\DevServer\9.0" /B WebDev.WebServer.EXE /port:4608 /path:"C:\Projects\a_project\Dev\path-to-site" /vpath:"/path-to-site"
    start http://localhost:4608/path-to-site/sitefinity/
    

    You'll notice I had to use the /D param to get into the right path (I wanted the user to be able to just run this off of their desktop) and then use /B param to run the given command in the background.

    Also, I found that in order to use the start command and just pass it a URL directly to just use the default browser you have to state the URL with no quotes.

    You can use the ASP.NET Dev Server for VS 2010 using the following:

    start /D "C:\Program Files\Common Files\Microsoft Shared\DevServer\10.0" /B WebDev.WebServer40.EXE /port:4608 /path:"C:\Projects\a_project\Dev\path-to-site" /vpath:"/path-to-site"
    start http://localhost:4608/path-to-site/sitefinity/
    

    Thanks for everyones help.