How to Integrate a Command Prompt into Windows Explorer

Command prompt

In this guide I will show you how you can integrate a command prompt into Windows Explorer

Integrate command Prompt in Windows Explorer

With this little tweak you can right click on a folder in Windows Explorer and start up a command prompt in that given path. If you often use batch scripts or start programs with command line parameters this can be very handy. As you can see if you click on the picture below I have added an extra option for my context menu of Windows Explorer. Whenever I right click on a folder I can click on click on “Command PromptCommand promptHere” This action will start up cmd.exe in the exact folder that I clicked on instead of the default location.

Command Prompt in Explorer

Before we start I better warn you that I if you are not familiar with making changes to the registry you can make some serious damage to you operating system. You might want to make a backup before you start…!

Well let’s get started:

1. First you need to start up the registry editor: regedit.exe 2. Go to the following path: HKEY_CLASSES_ROOT\Directory\shell

3. Right click on the shell folder, click New Key and name it CommandPrompt

4. Select the new CommandPrompt Key you just created and go to the right pane and double-click on the (Default) string that already is created there automatically.

5. Change the Value to “Command Prompt Here” or whatever you want the text to be.

6. Right click in the right pane and select New->String Value and name the string “Icon

7. Double-click on the string and change the data value to “C:\Windows\System32\cmd.exe
(If you want another Icon than the default cmd icon you just enter its location instead)

Registry tweak 1

8. Go back to the left pane again and right-click on the CommandPromt folder and select New Key and name the Key: Command

9. Select the Command folder you just created and move to the right pane again.

10. Double-click the (Default) string that already exist and change the data value to:
cmd.exe /k cd %1

Registry tweak2

That’s it, no need for a reboot. The things you change in the registry is working instantly. To test it startup an Explorer Windows find any Folder you like, right-click it and check that you now have a new option to start the Command Prompt for that given folder. For more information about cmd.exe and command-line parameters, please visit this Technet article.

Conclusion

I hope that the above guide was helpful and easy to follow and that you find this tip about adding a command Prompt to your Explorer context menu useful.

Related posts

7 Thoughts to “How to Integrate a Command Prompt into Windows Explorer”

  1. Rahul

    Cool Post. You blog provides lot of knowledgeable stuff, I like your writing style as well. Right now, I am integrating Command prompt with the Windows Explorer on my PC. Thanks for sharing.

    1. Hi Rahul
      Welcome to my blog. So glad you like my post and find it helpful. I have just visited your blog and it looks cool too. I would love to connect with you both on twitter and on each other’s blogs. I am sure that we both can learn from each other. I started this blog in Dec. 2010 and can see that your blog is even newer and that is also is running on WordPress. Hope to see you around Rahul. Have a nice day.

  2. Karen

    Very nicely put together, easy to understand and I love the use of the graphic sections to portray what you are describing 😉

    1. Thank you Karen
      You know pictures say more than a thousand words 🙂

  3. Bob

    You could’ve just pressed Shift + Right Click to bring up the “Open command window here” context option.

    1. That is a great tip Bob. Thanks for sharing 🙂

  4. Great Post. Thanks for sharing.

Leave a Comment