Home Windows How to Disable Command Prompt in Windows 11
Windows

How to Disable Command Prompt in Windows 11

Richard
Written byRichardTech Writer, IT Professional
Aug 22, 2021 Updated Apr 18, 2026 4 min read Reviewed Apr 18, 2026

This article describes how to enable or disable the command prompt in Windows 11.

The command prompt is a tool used to execute commands directly. Just as you can click on objects and windows using your mouse and keyboard, the command prompt allows you to perform similar functions by typing commands and executing them on the screen.

Using the command prompt, you can perform tasks similar to those done with a mouse and keyboard, all without the need for Windows or a graphical interface. The command prompt also allows you to execute advanced administrator functions and conduct repetitive tasks, as well as troubleshoot and resolve issues.

How to prevent users from using the command prompt

If you want to disable or restrict users from accessing the command prompt, follow these steps.

There are many ways to turn off the command prompt in Windows. You can turn it off using the Local Group Policy Editor or the Registry Editor.

Click on the Start menu, search for “Edit group policy,” then select and open.

Windows 11 Group Policy Editor for command prompt settings

When the group policy editor opens, expand the User Configuration ==> Administrative Templates ==> System.

Then double-click the policy item “Prevent access to the command prompt” to open.

Disabling command prompt in Windows 11 Group Policy

When the window opens, select Enabled, and under Options, choose to also Yes for “Disable the command prompt script processing also?“.

Enabled option to prevent access to command prompt in Windows 11

Click OK, and your changes should apply immediately. If not applied, restart your computer.

When the policy is applied, the next time a user opens the command prompt, they should see a similar message as below:

Disabled command prompt confirmation in Windows 11

How to turn off the command prompt via the registry editor

One can also turn off the command prompt via the Windows registry editor. To turn off the command prompt from the registry editor, go to the Start menu, then search for “Registry Editor” and select Open.

Registry Editor interface in Windows 11

Once the registry editor opens, navigate to the folder path below:

💻Code
ComputerHKEY_CURRENT_USERSoftwarePoliciesMicrosoftWindowsSystem

To get to that path quickly, simply copy the line above and paste it into the navigation box of the registry editor. If you haven’t changed your System policy, create the System folder (key) at the end of the line above.

Right-click in the blank area to the right of the folder, then select Create a new DWORD (32-bit) Value.

Disabling command prompt via Windows 11 Registry Editor

Then name the value:

💻Code
DisableCMD

Double-click the newly created value above to open. Then enter 1 to turn off the command prompt, including command scripts. 2 to Disable the command prompt only.

Registry settings for disabling command prompt in Windows 11

How to enable the command prompt in Windows 11

If you decide to turn off the command prompt above, undo the changes you made.

Go to the Group Policy Editor, expand the User Configuration ==> Administrator Templates ==> System, open the policy item “Prevent access to the command prompt,” and select Not configured.

Delete the file DisableCMD value you created above in the Windows registry under ComputerHKEY_CURRENT_USERSoftwarePoliciesMicrosoftWindowsSystem

That should do it!

Conclusion:

  • The command prompt is a powerful tool in Windows 11, enabling users to execute various commands efficiently.
  • Disabling the command prompt can enhance security in certain environments, preventing potential malware infections.
  • Users can disable the command prompt through both the Local Group Policy Editor and the Windows Registry Editor.
  • To revert changes and enable the command prompt again, simply reverse the steps taken during the disabling process.
  • Familiarizing yourself with these methods allows for greater control over system functionalities in Windows 11.

Frequently Asked Questions

How do I disable the command prompt in Windows 11?

You can disable the command prompt by using the Local Group Policy Editor or the Registry Editor. In the Group Policy Editor, navigate to User Configuration, Administrative Templates, System, and set 'Prevent access to the command prompt' to Enabled.

Can I disable the command prompt using the Registry Editor?

Yes, you can disable it by navigating to HKEY_CURRENT_USERSoftwarePoliciesMicrosoftWindowsSystem in the Registry Editor. Create a new DWORD (32-bit) value named 'DisableCMD' and set the value to 1 to disable the command prompt and scripts, or 2 to disable only the command prompt.

How do I re-enable the command prompt after disabling it?

To re-enable it, return to the Group Policy Editor and set the 'Prevent access to the command prompt' policy to 'Not configured'. If you used the Registry Editor, simply delete the 'DisableCMD' value you previously created.

What happens if I disable the command prompt in Windows 11?

When the command prompt is disabled, users will be prevented from executing commands or running command scripts directly. If a user attempts to open the command prompt, they will receive an error message stating that the action has been disabled by the administrator.

Is it safe to disable the command prompt on my computer?

Disabling the command prompt is a common security measure to prevent unauthorized users from running advanced commands or troubleshooting tools. However, ensure you have an alternative way to manage your system settings, as this will restrict your own ability to use command-line functions.

Was this guide helpful?

Tags: #Windows 11
Richard

About the Author

Richard

Tech Writer, IT Professional

Richard, the owner and lead writer at Geek Rewind, is a tech enthusiast passionate about simplifying complex IT topics. His years of hands-on experience in system administration and enterprise IT operations have honed his ability to provide practical insights and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.

Leave a Reply

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

Exit mobile version