Microsoft Windows – Open Command Window Here

[wpfilebase tag=file path='01/opencommandhere.zip']

NOTE: to use this feature you'll have to hold the SHIFT key on your keyboard!

Most of you probably already have done this, but just in case you haven't and find yourself frequently using cmd to run commands such as sqlcmd, you will find this registry "hack" useful.

I use sqlcmd on a weekly, if not daily, basis.  I'm constantly switching directories to where my scripts are.  Rather than switching directories in cmd, I can instead use the "Open Command Window Here" option in Windows Explorer.

To get this option on your machine, save the below as a .reg file and then double-click on it:

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\cmd]
@="Open Command Window Here"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\cmd\command]
@="cmd.exe /k \"cd %L\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Drive\shell\cmd]
@="Open Command Window Here"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Drive\shell\cmd\command]
@="cmd.exe /k \"cd %L\""

After you've modified the registry, open up Windows Explorer, right click on a directory, and then select the new option.  Notice how a cmd window opens in the requested directory.

Disclaimer: Modifying the registry can cause serious problems that may require you to reinstall your operating system.  Use the information provided at your own risk.

SOURCE

LINK

LANGUAGE
ENGLISH