Jasinski Technical Wiki

Navigation

Home Page
Index
All Pages

Quick Search
»
Advanced Search »

Contributor Links

Create a new Page
Administration
File Management
Login/Logout
Your Profile

Other Wiki Sections

Software

PoweredBy

Command Prompt Entry in a Folder's Shortcut Menu

RSS
Modified on Thu, Jun 13, 2013, 12:11 PM by Administrator Categorized as Windows (OS, IE, IIS, and MSMQ), Windows Registry

Overview

It’s handy to have an entry in the Windows Explorer context menu which will enable you to open a Command Window and automatically navigate to that folder. Here's how to create a Command Prompt entry on the context menus for both folders and drives. Similarly, this procedure will also add a VS Command Prompt entry (not shown in the screen shot below).

Image

Image

Procedure

  • Copy the following text into a text file and save it as C:\Data\VSCMD.BAT.

{copytext|vscmd}
%comspec% /k ""C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat"" x86
cmd.exe /k cd /d "%1"

  • Copy the following text into a text file and save it with a .REG file extension.

{copytext|registry}
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\cmd]
@="Command &Prompt"

[HKEY_CLASSES_ROOT\Directory\shell\cmd\command]
@="cmd.exe /k \"cd /d %L\""

[HKEY_CLASSES_ROOT\Drive\shell\cmd]
@="Command &Prompt"

[HKEY_CLASSES_ROOT\Drive\shell\cmd\command]
@="cmd.exe /k \"cd /d %L\""

[HKEY_CLASSES_ROOT\Directory\shell\vscmd]
@="&VS Command Prompt"

[HKEY_CLASSES_ROOT\Directory\shell\vscmd\command]
@="C:\\Data\\vscmd.bat \"%1\""

  • Double-click the newly-created REG file to merge it into the Windows Registry. You should see the commands in the shortcut menu without having to reboot.

Windows 7

  • On Windows 7, in order to see the new Command Prompt entry in the context menu, you must hold down the Shift key when right-clicking the folder/drive.

ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2014, Patrick Jasinski.