This post shows students and new users steps to disable or enable the command prompt when using Windows 11. The command prompt is used to execute commands. Similarly to you clicking on objects and windows with your mouse and keyboard, the command prompt allows you to perform the same functions, except each function is typed and executed on the command prompt.
By using the command prompt you can perform similar tasks as you’d using the mouse and keyboard, but without the windows and graphical interface. The command prompt is also used to perform advanced administrator functions, repetitive tasks, or troubleshoot and solve issues.
Another reason for disabling the command prompt is that it’s used as a vector of infecting one’s computer with viruses and malware. In some environment, the command prompt is disabled for security reasons. If you feel the same that you it may be better to disable it, the steps below will show you how to do that in Windows 11.
To get started disabling or enable the command prompt in Windows 11, follow the steps below:
How to prevent users from using the command prompt
As mentioned above, the command prompt is a terminal console that allows you to perform the same tasks and function as you’d using the mouse the graphical windows. If you wish to disable or prevent users from using the command prompt, use these steps.
There are many ways to disable the use of the command prompt in Windows. You can disable it using the Local Group Policy Editor or the Registry Editor.
Click on the Start menu, the search for “Edit group policy“, then select and open.
When the group policy editor opens, expand the User Configuration ==> Administrative Templates ==> System.
Then double-click the policy item “Prevent access to the command prompt” to open.
When the windows opens, select Enabled and under Options, choose to also Yes for “Disable the command prompt script processing also?“.
Click OK and your changes should apply immediately. If not applied, restart your computer.
When the policy is applied, the next time a user open the command prompt, the should see similar message as below:
How to disable the command prompt via registry editor
One can also disable the command prompt via Windows registry editor. To disable the command prompt from the registry editor, go to the Start menu, then search for “Registry Editor” and select to open.
Once the registry editor opens, navigate to the folder path below:
To get to that path quick, simply copy the line above and paste it into the navigation box of the registry editor. If you haven’t made any changes to your System policy, you’ll have to create the System folder (key) at the end of the line above.
There, right-click in the blank area to the right of the folder, then select to create a new DWORD (32-bit) Value.
Then name the value:
The double-click the newly created value above to open. Then enter 1 to disable the command prompt, including command scripts. 2 Disable command prompt only.
How to enable the command prompt in Windows 11
If you change your mind about disabling the command prompt above, simply reverse the changes you did above.
Go to the Group Policy Editor, then expand the User Configuration ==> Administrator Templates ==> System and open the policy item “Prevent access to the command prompt” and select Not configured.
Delete the file DisableCMD value you created above in Windows registry under Computer\HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System
That should do it!
This post showed you how to disable or enable the command prompt in Windows 11. If you find any error above, please use the comment form below to report.