Enable the command prompt via the GPO or Windows registry, disable

RECOMMENDED: Click here to fix Windows errors and optimize system performance

To prevent access to the command prompt in the window, you can use group policy settings or modify the Windows registry to disable the command prompt. When you do this, it prevents users from running the interactive command prompt or CMD.exe. Let’s see how we can do this under Windows 8/7.

Disable command prompt

Using GPO

Open the Run field, type gpedit.msc and press Enter to open the local group policy editor. Navigate to the next path:

User Configuration/Administrative Templates/System

In the right pane, you see Prevent access to the command prompt. Double-click to define the strategy. Select On and click Apply/OK.

This policy parameter prevents users from executing the Cmd.exe interactive command prompt. This policy setting also determines whether batch files (.cmd and.bat) can run on the computer. If you enable this policy setting and the user attempts to open a command window, the system displays a message indicating that a setting prevents action. If you disable or do not configure this policy setting, users can run Cmd.exe and batch files normally.

Here you can also disable script processing of the command prompt if you wish.

If your version of Windows does not have a group policy, you can do the following.

Use Registry

Start to open Registry editor :


If the Windows key or system key is missing, you may need to create it.

In the right pane, double-click DisableCMD and set the value to 0.

If DisableCMD is not present on your system, you may need to create a new DWORD value, name it DisableCMD, and then give it a value of 0.

If a user were now trying to open the CMD, they would see a message:

The prompt was disabled by your administrator.

February 2021 Update:

We now recommend using this tool for your error. Additionally, this tool fixes common computer errors, protects you against file loss, malware, hardware failures and optimizes your PC for maximum performance. You can fix your PC problems quickly and prevent others from happening with this software:

  • Step 1 : Download PC Repair & Optimizer Tool (Windows 10, 8, 7, XP, Vista – Microsoft Gold Certified).
  • Step 2 : Click “Start Scan” to find Windows registry issues that could be causing PC problems.
  • Step 3 : Click “Repair All” to fix all issues.


Enable CMD

If for any reason you need to do the opposite, i.e. enable the command prompt, simply disable option Prevent access to the command prompt. In the registry, you can delete DisableCMD DWORD or set its value to 1.

With our FixWin, you can also enable the prompt with a single click when it is disabled.

Hope this helps!

See this message if you want to prevent access to the Registry editor.

RECOMMENDED: Click here to troubleshoot Windows errors and optimize system performance

Related Video