The World’s Leading Microsoft .NET Magazine
   
 
««
February 2010
»»
SM
T
WTFS
  123456
78910111213
14151617181920
21222324252627
28

Mailing List

Jon Box Blog

VS2005 Command Prompt Here

Way back when, back in the days of COM and when Jerry had long hair, I used to take advantage of the Shell commands like "Command Prompt Here".  We even had INF files for register/unregister COM DLL's and several others.  It was convenient to right-client in Windows Explorer.  Then, came .NET and I pushed COM into the rearview mirror.  But the .NET Command Prompt showed up too - and it's a necessary evil.

Fortunately, someone came up with Command Prompt Here installs that have the environment variables for .NET utilities.  For example, Mike Gunderloy put out VS.NET 2003 Command Prompt Here.  I've taken his and updated it for VS2005.  This works for Beta2 and we'll see how it goes from there.  If the paths and batch file keep the same naming, it will work out for RTM.

Side Note: If you want a VS2005 Cmd Prompt in your Start Menu (assuming WinXP SP2), right-click on the Visual Studio 2005 Command Prompt, select "Pin to Start menu".  But, if you want the Command Prompt Here action in Windows Explorer, read on.  And, you can have both! <g>

Take the below text and put it into a *.INF text file.  Right click on the file and it will give you an Install option. After installation, it will also show up under "Add Or Remve Programs".

;
; "CMD Prompt Here" PowerToy
;
; Copyright 1996 Microsoft Corporation
;
; Modified to launch VS.NET 2003 command prompt 5/6/03 MG
; Modified to launch .NET V2 command prompt 3/31/05 www.jonbox.dotnetdevelopersjournal.com

[version]
signature="$CHICAGO$"

[VSNet2005CmdHereInstall]
CopyFiles = VSNet2005CmdHere.Files.Inf
AddReg    = VSNet2005CmdHere.Reg

[DefaultInstall]
CopyFiles = VSNet2005CmdHere.Files.Inf
AddReg    = VSNet2005CmdHere.Reg

[DefaultUnInstall]
DelFiles  = VSNet2005CmdHere.Files.Inf
DelReg    = VSNet2005CmdHere.Reg

[SourceDisksNames]
55="VS .NET 2005 CMD Prompt Here","",1

[SourceDisksFiles]
VSNet2005CmdHere.INF=55

[DestinationDirs]
VSNet2005CmdHere.Files.Inf = 17

[VSNet2005CmdHere.Files.Inf]
VSNet2005CmdHere.INF

[VSNet2005CmdHere.Reg]
HKLM,%UDHERE%,DisplayName,,"%VSNet2005CmdHereName%"
HKLM,%UDHERE%,UninstallString,,"rundll32.exe syssetup.dll,SetupInfObjectInstallAction DefaultUninstall 132 %17%\VSNet2005CmdHere.inf"
HKCR,Directory\Shell\VSNet2005CmdHere,,,"%VSNet2005CmdHereAccel%"
HKCR,Directory\Shell\VSNet2005CmdHere\command,,,"%11%\cmd.exe /k cd ""%1"" && ""C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\vsvars32.bat"""
HKCR,Drive\Shell\VSNet2005CmdHere,,,"%VSNet2005CmdHereAccel%"
HKCR,Drive\Shell\VSNet2005CmdHere\command,,,"%11%\cmd.exe /k cd ""%1"""

[Strings]
VSNet2005CmdHereName="VS.NET 2005 Command Prompt Here PowerToy"
VSNet2005CmdHereAccel="VS.NET &2005 CMD Prompt Here"
UDHERE="Software\Microsoft\Windows\CurrentVersion\Uninstall\VSNet2005CmdHere"

A visitor made this comment,
Or, you could buy a copy of TakeCommand/32, the *uber* command line :) (http://www.jpsoft.com/). No association, just a happy customer.

David

comment added :: 1st April 2005, 20:31 GMT-06
Mark made this comment,
Works great but it still needs entire Studio to be present. I was looking for a set of setting to register interop on a machine without a VS studio on it-that might be another challenge.
comment added :: 6th October 2006, 07:33 GMT-06

This blog is created and maintained by the author of the page and in no way associated with SYS-CON Media or .NET Developer's Journal. The author of the blog assumes all liability and responsibility personally for the content of the page.
www.blog-n-play.com is a registered trademark (78553120) of SYS-CON Media.