We are all familiar with Windows Command Prompt, which is used to execute several standard and administrative commands to perform various tasks. By using the command prompt, you can achieve similar functions as you are doing with a keyboard and mouse but without the graphical interface.

Due to security reasons, if you want to turn off the Command Prompt entirely on Windows 11, this gearupwindows article will help you. After disabling the command prompt, no user account on your computer can access it.

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

Although Group Policy Editor is the best method to apply a policy on Windows PC, it is not a part of the Windows 11 Home edition. 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. Open the Registry Editor.

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


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

Step 4. Now, 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. Name the newly created DWORD value as DisableCMD.

Step 6. When done, 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. Click OK.

To test if the Command Prompt is working, open the Run command box by pressing Windows + R keys from the keyboard. There, type cmd and then hit Enter from the keyboard to open the command prompt.

You should read a message, “The command prompt has been disabled by your administrator. Press any key to continue.” That means you will not be able to open the command prompt.

In the future, if you wish to enable the command prompt on your computer, 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?

Follow these steps to prevent Access to Command Prompt on Windows 11 through Local Group Policy Editor:-

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

Step 1 Open the Local Group Policy Editor.

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

User Configuration > Administrative Templates > System

Step 3. 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. In the “Prevent access to the command prompt” window, select the Enabled option.

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

Step 6. Click Apply.

Step 7. Click OK.

Step 8. Reboot your computer to apply the policy.

That’s it. Now command prompt and the related script will not work on your computer.

If you want to enable the command prompt and scripts, repeat the above steps, and in step 4 above, select the Not Configured option.

Good luck.


In conclusion, disabling the Command Prompt on Windows 11 can be done using two methods: Registry Editor and Local Group Policy Editor. While the former is suitable for Home edition users, the latter is applicable for Pro and Enterprise editions. Disabling the Command Prompt can be useful for security reasons, as it restricts access to the command line, including command scripts. However, if necessary, the Command Prompt can be enabled by reversing the steps mentioned in both methods. It is essential to note that caution should be exercised when making changes to the registry editor, as incorrect modifications may cause system errors.

Previous articleHow to Create Recovery Disk in Windows 11?
Next articleHow to Uninstall Microsoft Edge in Windows 11/10?


Please enter your comment!
Please enter your name here