How to Add ‘Open Command Prompt Here’ to Windows Navigating to a specific folder using the cd command in the Windows Command Prompt can be tedious, especially when dealing with deep directory structures. While Microsoft has pushed Windows PowerShell and Windows Terminal as the modern defaults, many developers and power users still prefer the classic Command Prompt (CMD).
This guide will show you how to permanently add “Open Command Prompt Here” to your right-click context menu using a quick Registry modification, as well as a hidden, instant address bar trick that requires no setup at all. Method 1: The Instant Address Bar Trick (No Setup Required)
If you need to open CMD in a specific folder right now and do not want to alter your system registry, Windows features a built-in shortcut through File Explorer. Open File Explorer and navigate to your target folder.
Click directly on the Address Bar at the top of the window (or press Alt + D to highlight it). Type cmd and press Enter.
A Command Prompt window will instantly launch, pre-targeted to that exact folder path. Method 2: Add “Open Command Prompt Here” via a .reg File
To permanently add the option to your right-click menu, you can merge a custom file into the Windows Registry. This is the safest and most efficient automated method. Step 1: Create the Registry Script
Right-click on an empty space on your desktop, hover over New, and select Text Document.
Open the new text file and paste the following code into it:
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\Directory\Background\shell\CommandPrompt] @=“Open Command Prompt Here” “Icon”=“cmd.exe” [HKEY_CLASSES_ROOT\Directory\Background\shell\CommandPrompt\command] @=“cmd.exe /s /k pushd \”%V\“” [HKEY_CLASSES_ROOT\Directory\shell\CommandPrompt] @=“Open Command Prompt Here” “Icon”=“cmd.exe” [HKEY_CLASSES_ROOT\Directory\shell\CommandPrompt\command] @=“cmd.exe /s /k pushd \”%V\“” Use code with caution. Step 2: Save and Merge the File Click File > Save As… in the text editor. Change the Save as type dropdown menu to All Files (.).
Name the file Add_CMD_Here.reg (the .reg extension is critical). Save the file to your desktop and close it. Double-click the newly created Add_CMD_Here.reg file.
Click Yes when the User Account Control (UAC) prompt appears, and click Yes again to confirm merging it into your registry.
Now, simply right-click any folder or the blank background inside a folder to select Open Command Prompt Here.
(Note: On Windows 11, you may need to right-click and select Show more options to see the classic context menu, or look for it directly if you use a modified context menu). Method 3: Add “Open Command Prompt Here (Admin)”
If you frequently run scripts or tools requiring elevated privileges, you can add an Administrator version of the shortcut.
Leave a Reply