Restoring 'OpenCmd' instead of 'PowerShell' in Windows 10 File Explorer

Abstract: Restore the classic Open Command Prompt here context menu in Windows 10 File Explorer by modifying registry keys to replace the default PowerShell option.

Created: 2026-08-04 by

To restore the classic "Open Command Prompt here" option in Windows 10 File Explorer, you must modify the Windows Registry. Microsoft replaced this feature with PowerShell by default in later updates. By editing specific registry keys under HKEY_CLASSES_ROOT, you can re-enable the legacy context menu item for folders and drives, allowing users to quickly launch cmd.exe instead of PowerShell.

Understanding the Context Menu Change

In earlier versions of Windows 10, right-clicking a folder or drive in File Explorer provided a straightforward "Open Command Prompt here" option. This was highly valued by system administrators and developers who preferred the stability and syntax of the traditional Command Prompt over PowerShell. However, as part of Microsoft's push toward modernizing the command-line interface, this option was deprecated and replaced with "Open PowerShell window here." While PowerShell is more powerful, many users find it slower to start or less compatible with legacy scripts that rely on CMD-specific behaviors. Restoring the old behavior does not require third-party tools; it can be achieved entirely through built-in system utilities. The process involves creating new registry entries that mimic the original functionality. It is important to note that these changes affect the shell experience globally for the current user profile. Before proceeding, ensure you understand the implications of modifying the registry, as incorrect edits can lead to system instability.

Creating the Registry Fix

The most reliable method to bring back the Command Prompt option is to create a custom registry file. This approach ensures that all necessary paths and parameters are correctly formatted without manual typing errors. You will need to use Notepad to create a text file that contains the registry commands. First, open Notepad. You can do this by searching for "Notepad" in the Start menu or pressing Win + R, typing notepad, and hitting Enter. Once the blank document is open, you will need to paste the following code block into it. This script defines two main sections: one for folders and one for the directory background (right-clicking empty space in a folder).
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\OpenCmdHere]
@="Open Command Prompt here"
"Icon"="cmd.exe"

[HKEY_CLASSES_ROOT\Directory\shell\OpenCmdHere\command]
@="cmd.exe /s /k pushd \"%V\""

[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHere]
@="Open Command Prompt here"
"Icon"="cmd.exe"

[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHere\command]
@="cmd.exe /s /k pushd \"%V\""

[HKEY_CLASSES_ROOT\Drive\shell\OpenCmdHere]
@="Open Command Prompt here"
"Icon"="cmd.exe"

[HKEY_CLASSES_ROOT\Drive\shell\OpenCmdHere\command]
@="cmd.exe /s /k pushd \"%V\""
Each section targets a different context within File Explorer. The Directory key applies when you right-click a folder icon. The Directory\Background key applies when you right-click the white space inside a folder. The Drive key applies when you right-click a drive letter in the left navigation pane or in "This PC". The "Icon"="cmd.exe" line ensures that the menu item displays the familiar blue terminal icon rather than the generic gear or arrow.

Saving and Executing the Registry File

After pasting the code into Notepad, you must save the file with the correct extension. Click File > Save As. In the "Save as type" dropdown, select All Files (*.*). Name the file something recognizable, such as restore-cmd.reg. Ensure the extension is exactly .reg, not .txt. Save this file to your Desktop or Documents folder for easy access. Once saved, locate the .reg file. Double-click it to initiate the import process. Windows will display a security warning asking if you want to proceed with adding the information to your registry. Click Yes. If prompted by User Account Control (UAC), confirm the action. Upon successful completion, you will see a message stating that the registry entries have been added successfully. To verify the change, open any File Explorer window. Right-click on a folder, the empty space within a folder, or a drive. You should now see "Open Command Prompt here" in the context menu. When selected, it will launch a Command Prompt window already positioned in that specific directory. The /k pushd "%V" parameter in the registry value ensures that the command prompt starts in the correct path and remains open after execution, which is often preferred for batch operations. For those interested in automating other PowerShell tasks, you might also check out Opt in Microsoft Automatic Updates using PowerShell to learn how to manage system settings programmatically. Additionally, understanding how to generate file lists efficiently can complement your command-line workflow, as detailed in Automatically Generate List Files with Filename and Folder Names using Windows CMD or PowerShell.

Reverting the Changes

If you decide that you prefer PowerShell or wish to undo this modification, you can remove the added registry keys. Create another Notepad file and paste the following code, ensuring you include the minus signs (-) before each registry path. These minus signs tell the registry editor to delete the specified keys.
Windows Registry Editor Version 5.00

[-HKEY_CLASSES_ROOT\Directory\shell\OpenCmdHere]

[-HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHere]

[-HKEY_CLASSES_ROOT\Drive\shell\OpenCmdHere]
Save this file as remove-cmd.reg and double-click it to execute. After confirming the prompts, the "Open Command Prompt here" option will disappear from the context menu, reverting to the default state where only PowerShell options are available. This clean removal prevents orphaned registry entries from cluttering your system.

Troubleshooting Common Issues

Sometimes, the registry edit may not appear immediately. This can happen due to caching issues in File Explorer. To force a refresh, you can restart File Explorer. Open Task Manager (Ctrl + Shift + Esc), find Windows Explorer in the processes list, right-click it, and select Restart. Alternatively, simply restarting your computer will apply the changes fully. If the option appears but fails to open a command prompt, check the registry path again. Ensure there are no typos in the command subkey. The value should be exactly cmd.exe /s /k pushd "%V". Any deviation, such as missing quotes around %V, can cause the command to fail or open in the wrong directory. Also, ensure that cmd.exe is still present in your C:\Windows\System32 folder, although this is rare on standard Windows installations.

Frequently Asked Questions

Does this work on Windows 11?

Yes, the registry structure is largely similar between Windows 10 and 11. However, Windows 11 has its own context menu implementation that may hide older items. You might need to click "Show more options" to see the restored CMD entry, or use third-party tools like ShellExView to manage the menu visibility more effectively.

Will this change affect Administrator privileges?

No, this change only affects the starting directory and the application launched. If you need an elevated Command Prompt, you must still right-click the shortcut or search for CMD and select "Run as administrator." The registry fix does not automatically grant administrative rights upon opening the menu.

Can I customize the icon for the menu item?

Currently, the registry script sets the icon to cmd.exe. You can change this to any other executable or DLL file that contains icons, such as shell32.dll or imageres.dll, by modifying the "Icon" value. For example, you could point it to a specific index number within a DLL to get a different visual style.

Why did Microsoft remove the CMD option?

Microsoft removed the default CMD option to encourage users to adopt PowerShell, which offers more robust scripting capabilities, object-oriented output, and better integration with modern Windows management tools like Azure and Office 365. They view PowerShell as the future of system administration on Windows platforms.

Is it safe to edit the registry manually?

Editing the registry carries risks, as incorrect modifications can break system functionality. Using a pre-written .reg file minimizes the chance of syntax errors. Always back up your registry or create a system restore point before applying any registry changes. This allows you to roll back if something goes wrong during the import process.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More