Skip to content
Follow
Windows

How to Disable Command Prompt in Windows 11

Richard
Written by
Richard
Aug 22, 2021 Updated Sep 15, 2026 2 min read
How to Disable Command Prompt in Windows 11
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.

Advertisement

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.

⚡ Quick Answer

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\Software\Policies\Microsoft\Windows\System and create a DWORD value named DisableCMD, setting its value to 1 or 2.

Advertisement

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

MethodBest ForDifficulty
Group PolicyWindows 11 Pro/EnterpriseEasy
Registry EditorWindows 11 HomeAdvanced

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.

  1. Press the Win+R, type gpedit.msc, and press Enter.
  2. Navigate to User Configuration > Administrative Templates > System.
Advertisement
Windows 11 Group Policy Editor for command prompt settings
windows 11 edit group policy

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

Disabling command prompt in Windows 11 Group Policy
windows 11 disable command prompt group policy

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

Enabled option to prevent access to command prompt in Windows 11
windows 11 prevent access to command prompt enabled

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

Disabled command prompt confirmation in Windows 11
windows 11 command prompt disabled

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.

Advertisement

1. Press the Windows key + R, type regedit, and press Enter.

Registry Editor interface in Windows 11
registry editor in windows 11

2. Navigate to HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System.

🗝️Registry
HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System

3. Right-click in the empty space, select New, and choose DWORD (32-bit) Value.

Disabling command prompt via Windows 11 Registry Editor
windows 11 disable command prompt registry

4. Name the new value DisableCMD.

Advertisement
💻Code
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.

Registry settings for disabling command prompt in Windows 11
windows 11 disablecmd registry

Pro Tip: Testing the Restriction

⚠️WarningBefore you lock yourself out, create a new standard user account on your PC.

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?

Tags: #Windows 11
Was this helpful?
Richard

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.

Advertisement

📚 Related Tutorials

How to Open Command Prompt at Boot In Windows 11
Windows How to Open Command Prompt at Boot In Windows 11
How to Set Windows Terminal to Open with Command Prompt on Windows 11
Windows How to Set Windows Terminal to Open with Command Prompt on Windows 11
How to Switch HKCU and HKLM Registry Keys in Windows 11
Windows How to Switch HKCU and HKLM Registry Keys in Windows 11
How to Reset Group Policy Windows 11 to Default
Windows How to Reset Group Policy Windows 11 to Default

No comments yet — be the first to share your thoughts!

Leave a Comment

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