How to Disable Command Prompt in Windows 10

Here are two ways to disable the Command Prompt in Windows 10. Let’s get started.

Method #1

Open local group policy editor.

Navigate to the User Configuration > Administrative Templates > System.

Double-click “Prevent access to the command prompt” in the right pane.

Select Enabled.

Select Yes from the drop-down list if you do not wish to run batch files (.cmd and .bat).

Click the OK button.

That’s all.

To enable Command Prompt, follow the above steps but select Not Configured or Disabled.

Method #2

Launch Registry Editor. I suggest a Registry backup before proceeding.

Go to HKEY_CURRENT_USER > Software > Policies > Microsoft > Windows.

Hit System. If it is not there, create it. You can do this by right-clicking on Windows and selecting New > Key, then typing System and hitting Enter.

Now right-click on the blank space in the right pane.

Select New > DWORD (32-bit) Value.

Enter DisableCMD and press Enter.

Double-click it and enter 2 (to disable Command Prompt) or 1 (to disable Command Prompt and running batch files) in the Value field.

Hit the OK button.

That’s all.

From now on, you will see this message every time you access the Command Prompt:

The command prompt has been disabled by your administrator.

Press any key to continue.

Note: To enable Command Prompt, remove the DWORD you’ve created above.