How to Integrate a Command Prompt into Windows Explorer


In this guide I will show you how you can integrate a command prompt into 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 Prompt Command 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 thisTechnet article.

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.

About the author:
I am an IT Professional that has this blog as a hobby project in my spare time. I have been in the IT business since 1996 and want to share some of the thing I have picked up over the years, with people who visit this blog.

>>Subscribe to my Newsletter<<

7 Responses to How to Integrate a Command Prompt into Windows Explorer

  1. Rahul says:

    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.

    • Thomas says:

      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 says:

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

  3. Bob says:

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

  4. Pradeep Pant says:

    Great Post. Thanks for sharing.

Leave a Reply

Your email address will not be published. Required fields are marked *