How to Disable Command Prompt in Windows 11
Disabling Command Prompt stops people from running text-based commands that can break your Windows 11 PC. Command Prompt, also known as cmd.exe, is a built-in tool that lets you run instructions directly to change system files.
Blocking access to this tool adds a strong safety net for shared computers in homes or schools. You can turn it off in a few minutes using the Group Policy Editor on Windows 11 Pro or Enterprise editions.
You can disable the Command Prompt using either the Group Policy Editor or the Registry Editor. For Group Policy, navigate to User Configuration Administrative Templates System and enable “Prevent access to the command prompt.” For the Registry Editor, go to 🗝️HKEY_CURRENT_USER\
What happens when you disable the Command Prompt?
When you disable Command Prompt, Windows blocks the app from opening. Trying to run a command will show an error message. This also prevents many script files from running, helping keep your computer safe from malicious software.
Comparison: Registry vs. Group Policy
| Method | Best For | Difficulty |
|---|---|---|
| Group Policy | Windows 11 Pro/Enterprise | Easy |
| Registry Editor | Windows 11 Home | Advanced |
How to disable Command Prompt using Group Policy (Pro/Enterprise)
You can disable Command Prompt using Group Policy on Windows 11 Pro and Enterprise to stop anyone from opening the command line tool. Open the Local Group Policy Editor by pressing the Win plus R, typing gpedit.msc, and pressing Enter. Go to User Configuration, then Administrative Templates, and select System to find the policy that blocks access.
- Press the Win+R, type gpedit.msc, and press Enter.
- Navigate to User Configuration > Administrative Templates > System.

3. Find Prevent access to the command prompt and double-click it.

4. Select Enabled. You can also choose to disable scripts here too.

5. Click OK. If it doesn't take effect immediately, restart your computer.

How to disable Command Prompt via Registry Editor
You can disable Command Prompt via Registry Editor if you use Windows 11 Home and do not have access to the Group Policy Editor. Open Registry Editor by pressing the Windows key plus R, typing regedit, and pressing Enter. Go to HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System to create a new value that blocks the command line.
1. Press the Windows key + R, type regedit, and press Enter.

2. Navigate to HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System.
HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System
3. Right-click in the empty space, select New, and choose DWORD (32-bit) Value.

4. Name the new value DisableCMD.
DisableCMD
5. Double-click DisableCMD and set its value to `1` to block all command-line access, or `2` to block only the prompt itself.

Pro Tip: Testing the Restriction
Apply the changes to that account first to ensure you can still access your main administrator account if something goes wrong.
Summary
Disabling Command Prompt on your Windows 11 PC adds an extra layer of security. You can choose between the Group Policy Editor for Pro/Enterprise versions or the Registry Editor for Home versions. Remember, these changes can be undone by an administrator.
Was this guide helpful?
About the Author
Richard
Tech Writer, IT Professional
Richard is a writer at Geek Rewind who turns complex IT tasks into clear, step-by-step guides. He draws on years of hands-on experience in system administration and enterprise IT operations, focusing on Windows, Linux and WordPress: the problems people actually run into, and the fixes that work. His server and WordPress guides come from systems he runs himself. Richard builds and maintains the platform behind Geek Rewind, from its Ubuntu servers and Nginx configuration to its custom WordPress plugins. Many new tutorials start with readers' questions, and he's always glad to answer them in the comments.
No comments yet — be the first to share your thoughts!