Monday, December 31, 2007

Add Command Prompt to Shell Context Menu

The following Registry entries provide a new entry when right clicking on Directories in Windows Explorer. This new "Command Prompt" entry will open up a Windows command prompt with the right clicked folder as the current directory:

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\Command]@="Command Prompt"
[HKEY_CLASSES_ROOT\Directory\shell\Command\command]@="cmd.exe /k cd %1"

Change Windows Batch file "editor"

When you right click on a *.bat file in Windows, you have the option to "Edit" the file. You're out of luck, however, if you'd like to use your own editor since you can't find batch files listed in Folder Options.

Here's the registry key to modify to run your own text editor:
HKLM\Software\Classes\batfile\shell\edit\command

The default value normally contains a path reference to notepad.exe. I changed mine to run with SlickEdit by using the following entry:
%ProgramFiles%\SlickEdit\win\vs.exe %1

As soon as I saved this entry and right clicked a batch file, selected edit, and it popped up in SlickEdit.