Followers

Monday, October 10, 2011

Command Prompt on Right-Click

Many computer users, specially the programmers, need to launch a command prompt window every once in a while to execute some dos/shell commands. The problem is, when a command prompt window launched, the default path is normally the system path or the user profile's path. The users will then have to do all the "cd" commands to change the directories to the path he/she wants.

This trick shows you how to add an option called "Command Prompt" when you right-click on a folder in Windows. With this option, a Command Prompt Window will launch and its current directory will be the path to the folder you've selected.

Use this trick at your own risk.

Here's what you'll get:




The Solution
You can either edit your registry OR download the registry file and apply it on your computer.

Method I. Manually edit the registry:

  1. Start > Run
  2. Enter "regedit" and hit Enter
  3. Expand to "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell"
  4. Right-click on "shell" and select New > Key
  5. Make sure a new key is created under "shell". Change the name of this key to "Command Prompt"
  6. Right-click on this new key "Command Prompt" and select New > Key
  7. Change the name of this key to "command"

  8. Here's what we should have:

  9. Double-click on the "(Default)" text on the right window to bring up the edit box
  10. Enter this text into the Value Data field:
    cmd.exe "%1"
  11. Click OK and close the registry.

Method II. Download and apply the registry file:

  1. Download this registry file Here
  2. Unzip it to a temp folder, then double-click on the .reg file to add the registry data.

13 comments:

  1. i always have this on my computers much usefull for looking for viruses and other stuff at work! an easier way is to open a notepad and paste the next lines, then save the file as "opencmd.reg" WITH QUOTES! and doble click on it (else it will be saved as opencmd.reg.txt)

    --------------------

    Windows Registry Editor Version 5.00

    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\Command Prompt\command]
    @="cmd.exe \"%1\""

    ----------------

    ReplyDelete
  2. for windows Xp i think you put this withotu the first line


    ------------
    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\Command Prompt\command]
    @="cmd.exe \"%1\""
    -----------

    ReplyDelete
  3. Good info, though not for everyone

    ReplyDelete
  4. Very useful! I could see how this would make progrmaers live's so much easier!

    ReplyDelete
  5. love this feature i use it almost once a week

    ReplyDelete
  6. Actually need this site to navigate my old PC xD thanks!

    ReplyDelete
  7. great post, and great tutorial thx =)

    ReplyDelete