As Command Prompt isn’t the primary command-line interpreter anymore, the “open command window here” option has disappeared from the context menu in Windows 11 and 10. That option enabled users to open directories in the Command Prompt by right-clicking their folders from File Explorer. This is how you can restore that option on Windows 11’s context menu.
How to Restore the Open Command Window Option With a Registry Script
To restore the Open command window here option on the context menu, you’ll need to apply a registry tweak one way or another. Instead of manually editing the registry yourself, you can set up a registry script file to do it. These are the steps for setting up a REG script file that restores the missing Open command window option.
Press the Windows search button (magnifying glass icon) on the taskbar. Type Notepad in the search tool, and select to open that app. Copy this registry script code text with the Ctrl + C keyboard shortcut: Windows Registry Editor Version 5. 00 [HKEY_CLASSES_ROOT\Directory\Shell\OpenElevatedCmd] @=“Open command prompt here as administrator” “Icon”=“cmd. exe” [HKEY_CLASSES_ROOT\Directory\Shell\OpenElevatedCmd\command] @=“PowerShell -windowstyle hidden -Command "Start-Process cmd. exe -ArgumentList ‘/s,/k,pushd,%V’ -Verb RunAs"” [HKEY_CLASSES_ROOT\Directory\Background\Shell\OpenElevatedCmd] @=“Open command prompt here as administrator” “Icon”=“cmd. exe” [HKEY_CLASSES_ROOT\Directory\Background\Shell\OpenElevatedCmd\command] @=“PowerShell -windowstyle hidden -Command "Start-Process cmd. exe -ArgumentList ‘/s,/k,pushd,%V’ -Verb RunAs"” [HKEY_CLASSES_ROOT\Drive\Shell\OpenElevatedCmd] @=“Open command prompt here as administrator” “Icon”=“cmd. exe” [HKEY_CLASSES_ROOT\Drive\Shell\OpenElevatedCmd\command] @=“PowerShell -windowstyle hidden -Command "Start-Process cmd. exe -ArgumentList ‘/s,/k,pushd,%V’ -Verb RunAs"” [HKEY_CLASSES_ROOT\LibraryFolder\background\Shell\OpenElevatedCmd] @=“Open command prompt here as administrator” “Icon”=“cmd. exe” [HKEY_CLASSES_ROOT\LibraryFolder\background\Shell\OpenElevatedCmd\command] @= Click inside Notepad and press the Ctrl + V key combination to paste the copied script code into the text editor. Then select File > Save as in Notepad. Select the All Files option on the Save as type drop-down menu. Enter Open command window (Admin). reg in the File name text box. Select Desktop on the left side of the Save as window. Click Save on the window. Close the Notepad app, and double-click the Open command window. reg file on the desktop. Select Yes on the Registry Editor prompt, and click the OK button.
Now you can select a new Open Command Prompt here option on the context menu. Right-click a folder in File Explorer and select Show more options. Select the Open Command Prompt here as administrator option to open the folder’s directory within a Command Prompt window.
You can remove that option from the menu anytime by deleting the registry key for it. To do so, you’ll need to open the Registry Editor first. Press the Windows + R hotkey, type regedit in the Open box, and select OK.
Next, go to the Computer\HKEY_CLASSES_ROOT\Directory\shell key location in the Registry Editor. Right-click the OpenElevatedCmd registry key and select Delete. Click Yes when prompted to confirm.
Read also: What Is the Windows Registry and How Do I Edit It?
How to Restore the Open Command Window Option With Winaero Tweaker
The freeware Winaero Tweaker desktop app provides an alternative way to restore an Open command window context menu option. That software includes a Command Prompt as Administrator option you can select to add an Open command window shortcut for folders to the right-click menu. This is how to install Winaero Tweaker and select that option.
Open the homepage for Winaero Tweaker. Click the Download Winaero Tweaker link there. Press the Windows and E keys simultaneously, and open the folder in which you saved Winaero Tweaker’s ZIP file. Double-click the Winaero Tweaker ZIP archive, and select Explorer’s Extract all option. Select Show extracted files when complete on the Extract Compressed (Zipped) Folders window. Click Extract to bring up an extracted folder for Winaero Tweaker. Double-click WinaeroTweaker-1. 33. 0. 0-setup to open the installer, and click the Next button. Select the Normal mode, I accept the agreement, and Create a desktop icon options within Winaero Tweaker’s setup window. Then click the Install button. Double-click Winaero Tweaker’s desktop shortcut. Expand the Context Menu category in Winaero Tweaker. Click the Command Prompt as Administrator option. Then select the Add elevated Command Prompt to the context menu checkbox. Erase the text in the Context menu entry title box. Then input Open command window here in that text box. Press the Apply Changes button, and close Winaero Tweaker.
Check out the new context menu option by right-clicking a folder and selecting Show more options. Or you can select a folder and press the Shift + F10 hotkey. Selecting Open command window here on the classic context menu will open a folder’s directory in an elevated Command Prompt like the one applied with the registry script.
How to Configure the Open in Windows Terminal Option to Open With Command Prompt
Windows 11’s context menu includes an Open in Windows Terminal option that opens a folder directory within the Terminal’s default command-line interpreter. PowerShell is the default Windows Terminal interpreter, but you can change that to Command Prompt. Then a folder’s directory will open in a Command Prompt tab whenever you select Open in Windows Terminal.
Right-click Start on the taskbar to select and open Windows Terminal. Click the Open a new tab (arrow) button to select Settings. Select Command Prompt on the Default profile drop-down menu. Press the Save button at the bottom right of the Settings tab. Click the Close button at the top right of Windows Terminal.
Try selecting the Open in Windows Terminal option by right-clicking a folder. The Windows Terminal will now open with a Command Prompt tab when you select that option. If you prefer the Command Prompt to open with a separate administrator window, however, you’ll need to add a new option to the context menu as outlined for the previous two methods.
Read also: How to Open the Windows Terminal in Windows 11
The Open Command Window Here Option Is a Convenient Command Prompt Shortcut
The Open command window here context menu option is a handy shortcut for all Command Prompt users. Having that option on the right-click menu will save you needing to manually open folders in the Prompt with the change directory (CD) command. So, it’s worth restoring that option in Windows 11 if you often utilize the Command Prompt.