1/25/2007

Get a “Command Prompt Here” context menu in explorer

Filed under: Developing .NET, Software — Guus @ 5:30 pm

Wouldn’t it be nice to have something like this:

Wow: command prompt here

 

You can use this technique for any command line or batch file you want to attach to the Explorer context menu. 

  1. Add a key (any name and content appears to work) to HKEY_CLASSES_ROOT\Folder\shell.
  2. Below that add a key “command” and set the text to be whatever command you want executed.  I copied the command line from the .NET 3.0 SDK “CMD Shell” (see registry export listing below), but you could use any command line entry.  The nice thing about the .NET 3.0 cmd shell is that it sets the environment so you can access svcutil.exe and other 3.0 specific utilities.

Registry export listing:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Folder\shell\Command Prompt]
@=”.NET 3.0 Command Prompt”

[HKEY_CLASSES_ROOT\Folder\shell\Command Prompt\command]
@=”C:\\WINDOWS\\system32\\cmd.exe /E:ON /V:ON /T:0E /K \”C:\\Program Files\\Microsoft SDKs\\Windows\\v6.0\\Bin\\SetEnv.Cmd\”"

BTW:  If you’re running Vista then you’re in luck, it’s built-in! 

 

No Comments »

No comments yet.

RSS feed for comments on this post. | TrackBack URI

Leave a comment

XHTML ( You can use these tags): <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> .