Wednesday, July 16, 2008

How to get to the command prompt by registry file add

Very frequently we need to create command prompt at a certain folder. Most users directly go to command prompt and then type out the entire pathname to get to the required folder.
Would it not be much easier to get to the command prompt by directly right-clicking on the folder?
Below is how you can do it. This is valid only for Win XP. Other operating systems have not been checked.

1. Create a text file wherever it is easy for you to access it.
2. Copy and past the following data into the file command.txt :

REGEDIT4
[HKEY_CLASSES_ROOT\Directory\shell\DosHere]
@="Command &Prompt Here"

[HKEY_CLASSES_ROOT\Directory\shell\DosHere\command]
@="C:\\Windows\\System32\\cmd.exe /k cd \"%1\""

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

[HKEY_CLASSES_ROOT\Drive\shell\DosHere\command]
@="C:\\Windows\\System32\\cmd.exe /k cd \"%1\""

3. Save the file
4. Now rename the extension from a command.txt to a command.reg (registry type file). Go to DOS prompt and type C:\ren command.txt command.reg
5. Double clicking the file will pop up a dialog box saying "Are you sure you want to add the data to the registry".
6. Say yes and the data gets added into your windows registry.
7. Now any folder where you want a command prompt, it is as easy as right clicking on the folder and choosing "Command Prompt Here".

Simple as that....

No comments: