How to Disable Command Prompt on Windows 11?


Command Prompt is an essential part of Windows that can manipulate most Windows settings. Using the command prompt, you can achieve similar functions with a keyboard and mouse but without the graphical interface.

Suppose all users have access to the command prompt. In that case, there are high chances that people can misuse it, making your computer vulnerable to security threats, and even compromising your system settings. Luckily, disabling and enabling Command Prompt in Windows is a straightforward task and can be achieved in 2 different ways; Through the Registry Editor and the Local Group Policy Editor. In this risewindows article, we will show you how to do that.

How to Prevent Access to Command Prompt on Windows 11 using Registry Editor?

Group Policy Editor is not a part of the Windows 11 Home edition, but it is the best method to apply a policy on Windows PC. So, you need to use Registry Editor to apply a policy on your Windows 11 Home computer if you use it. Rest all Pro and Enterprise editions users can continue using Group Policy.

To disable the command prompt on your computer or laptop, do the following steps:-

Step 1. First, open the Registry Editor.


Step 2. Now, in the Registry Editor window, navigate to the following key from the left side pane:-


Step 3. So, right-click on the Windows folder and select the New > Key option. Name it as System.

Step 4. Then, select the newly created System key by clicking on it. Right-click in the blank space on the right-side pane and choose New > DWORD (32-bit) Value.

Step 5. After that, name the newly created DWORD value as DisableCMD.

Step 6. Once it is complete, double-click the DisableCMD to open its settings. Then enter the following value in the “Value data” field:-

  • 1 – Disables the command prompt, including command scripts.
  • 2 – Disables command prompt only.

Step 7. Then, click OK.

If the Command Prompt is working, open the Run command box by pressing Windows + R keys from the keyboard. There, typecmdand then hit Enter from the keyboard to open command prompt.


You should read a message here: “Your administrator has disabled the command prompt. Press any key to continue.” That means you will not be able to open the command prompt.

If you want to enable the command prompt on your computer in the future, browse to the following key in the registry editor:-


Then delete the DisableCMD DWORD (32-bit) Value that you have created.

How to Stop Access to Command Prompt on Windows 11 through Local Group Policy Editor?

Quick Note: You’ll need to enable Local Group Policy Editor in Windows 11 Home edition.

Step 1. First, open the Local Group Policy Editor.

Step 2. Now, when the Local Group Policy Editor opens, navigate to the following path from the left sidebar:-

User Configuration > Administrative Templates > System

Step 3. Then, look for the policy name, “Prevent access to the command prompt,” and double-click on it to configure its settings on the right-side pane.

Step 4. After that, in the “Prevent access to the command prompt” window, select the Enabled option.

Step 5. Next, in the Options section, select Yes for “Disable the command prompt script processing also?”

Step 6. Now, click [/keybt]Apply[/keybt].

Step 7. Then, click [/keybt]OK[/keybt].

Step 8. Finally, reboot your computer to apply the policy.

Now command prompt and the related script will not work on your computer.

To enable command prompt and scripts, repeat the above steps, and in step 4 above, select the Not Configured option in the future.

That’s it for the article.

I hope this post will be informative to you.

Good luck & keep learning, guys.

Also, read How To Disable File Compression Using Group Policy and Command Prompt on Windows 11 or 10?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.