As I learn to automate

Friday, June 16, 2006

Open a website in Visual Studio 2005 from the command line

You can find devenv .exe at:C:\Program Files\Microsoft Visual Studio 8\Common7\IDE
Like most other standard commands “devenv /?” will get you its usage:




But, ASP.NET 2005 allows you to have a “website” purely as a folder. How do we open those?

Well, in reality there is a *.sln that we don’t see, typically at: C:\Users\\Documents\Visual Studio 2005\Projects\\.sln

So, we could do:devenv C:\Users\\Documents\Visual Studio 2005\Projects\\.sln

Or, act as if we didn’t know about this hidden sln file and create a macro. Clcik here for BradleyB's WebLog which has instructions on how to do that!

After that, just to save some more typing: create this batch file:

REM // show usage if specified
if {%1}=={-?} goto :usage
if {%1}=={/?} goto :usage

"C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv" /command "Macros.MyMacros.Website.OpenWebsite C:\inetpub\wwwroot\%1"

exit /b 0

:usage
echo Open VS 2005 devenv for a specified website
echo
echo usage: goDevEnv
exit /b 1

You can then just type this at the command line:
goDevEnv

0 Comments:

Post a Comment

<< Home