.NET Command Prompt Here... and Everywhere Else!

I got a comment on my Solvent entry about how a VS.NET command prompt would be a handy thing to have on the right-click menu.

I guess I assumed everyone developing had already fixed their default command prompt so it's ALWAYS a VS.NET command prompt. I find I have little use for a command prompt that doensn't have all of the VS.NET environment stuff set up on it.

For those who haven't, and figured it'd be nice, here's the registry hack that will automatically run the vsvars32.bat file when you get a command prompt. Note that there is a similar article out there advocating the use of the "/k" option to run the file. I don't use that; instead, I use the "AutoRun" registry key so regardless of how you access the command prompt - even if you do a Start -> Run and type "cmd" and click OK - you'll always get a VS.NET command prompt. (It'll even fix it so if you have the Command Prompt Here power toy installed, that command prompt is a VS.NET command prompt, too.)

It looks like this:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor]
"AutoRun"="\"%VS71COMNTOOLS%vsvars32.bat\""


Or you can download a text file with that already set. Rename it to have a ".reg" extension, then merge it with your registry.

Download vsnetcmd.reg (right-click, "Save As...")

Print | posted @ Monday, June 28, 2004 10:28 AM

Comments on this entry:

Gravatar # Re: .NET Command Prompt Here... and Everywhere Else!
by Hardeep at 4/10/2007 12:39 PM

Cool tip - thanks for sharing. This will save loads of time with setting the PATH environment variable for various batch files and when using the command prompt here context menu as you suggested.

Thanks again.
Gravatar # ComputerZen.com - Scott Hanselman's Weblog - Scott Hanselman's 2005 Ultimate Developer and Power Users Tool List
by www.hanselman.com at 6/19/2005 9:54 PM

Gravatar # Scott Hanselman's Computer Zen - Scott Hanselman's 2006 Ultimate Developer and Power Users Tool List for Windows
by www.hanselman.com at 8/29/2006 1:44 AM

Your comment:

Title:
Name:
Email:
Website:
 
Italic Underline Blockquote Hyperlink
 
 
Please add 5 and 7 and type the answer here: