How to Disable Command Prompt in Windows 11

Command Prompt is a very important part of Windows from where most of the Windows settings can be manipulated. If all the users have access to the command prompt, it is highly likely that people could misuse it and make your computer vulnerable to security threats and even jeopardise your system settings. Fortunately, in Windows, disabling and enabling command prompt is a super easy task and it can be achieved in 2 different ways; through the Registry editor and through the Local Group Policy Editor.


ADVERTISEMENT

In this article, we explain how you can easily disable your command prompt so that your system is protected from unwanted setting changes.

How to Disable Command Prompt Through Registry Editor

Unstable registry settings can definitely cause serious issues to your system and it is very highly recommended to take a backup of your registry settings before making any changes to it. If anything undesirable happens after you make changes to the Registry Editor, you can always restore your previous settings using this backup.

Step 1: Launch the Run window by pressing the Win and R keys at once.

Type in regedit and hit the OK button.

 

1 Run Regedit Optimized

 

Step 2: In the Registry Editor window, copy & paste the following URL in the navigation bar first.

Computer\HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows

Make sure you are on the folder Windows. As next, right click on the Windows folder, click on New and then click on the Key option.

 

2 New Key Optimized

 


ADVERTISEMENT

Step 3: Click on the newly created key, press F2 and name it as System.

 

3 Rename To System Optimized

 

Step 4: Now select the System key by clicking on it. On the right side of the window, right click on an empty space. Click on the New option from the right click context menu and then click on DWORD (32-bit) Value.

 

4 New Dword Optimized

 

Step 5: Name the newly created DWORD value as DisableCMD by pressing the F2 button to rename.

 

5 Name Dword Optimized

 

Step 6: Now double click on the DisableCMD DWORD to edit its Value data field. Give the value as 1 to disable the Command Prompt.

 

6 Value Data 1 Optimized

 

That’s it. If you would like to test whether you have successfully disabled the Command Prompt or not, please follow the steps below.

How to Check Whether Command Prompt is Disabled or Not

Step 1: Launch the Run window by pressing the keys Win & R together. Type in cmd and hit Enter key.

 

7 Run Cmd Optimized

 

Step 2: Command Prompt would launch, but you will get the message The command prompt has been disabled by your administrator, proving you have successfully disabled the Command Prompt in your machine.

 

8 Cmd Disabled Optimized

 

How to Revert Disabling Command Prompt

If you ever want to enable the Command Prompt back again, simply browse to the same URL,

Computer\HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System

and delete the DisableCMD DWORD value you created under the System key.

 

6 Z Delete Dword Optimized

 

How to Disable Command Prompt Through Local Group Policy Editor

Step 1: Launch the Run window first, by pressing Win and R keys simultaneously.

Type in gpedit.msc and hit Enter key to launch the Local Group Policy Editor window.

 

9 Run Gpedit Optimized

 

Step 2: In the Local Group Policy Editor window,

  1. Expand the User Configuration folder first, in the left window pane.
  2. Then expand the Administrative Templates folder.
  3. Finally, expand the System folder.
  4. Now in the right pane of the window, double click on the setting named Prevent access to the command prompt.

 


ADVERTISEMENT

10 Prevent Cmd Access Optimized

 

Step 5: Choose the radio button corresponding to Enabled first.

Now, under the section Options, choose Yes against Disable the command prompt script processing also? question.

Once done, hit Apply and OK buttons.

 

11 Disable Cmd Optimized

 

Step 6: If you ever want to enable the Command Prompt again, simply choose the radio button corresponding to Not Configured instead of Enabled in the same window.

 

12 Not Configured Optimized

 

That’s it. Please tell us in the comments whether you found the article useful.

ADVERTISEMENT