The Command Prompt console is a valuable and built-in tool on Windows 10 to quickly execute commands to make system settings and run non-graphical apps. It also helps troubleshoot problems and automates tasks. If you want to disable the Command Prompt access for all users to prevent users from running unwanted commands, the task can be achieved through two methods.
In other words, you can prohibit access to the Command Prompt on Windows 10 through at least two ways: Group Policy Editor or Registry Editor.
In this post, we will learn two possible ways to disable the Command Prompt console for all users on Windows 10:-
- How to block Command Prompt access with Group Policy Editor?
- How to turn off Command Prompt with Registry?
How to Restrict Command Prompt Access with Group Policy Editor?
If you are running Windows 10 Pro (Enterprise or Education), Local Group Policy is the easiest way to block users from using Command Prompt. If you are still using Windows 10 Home Edition, then either use the registry method or enable Group Policy Editor on Windows 10 Home, then proceed further with this method.
Step 1. Press
Step 2. Type the following and press
gpedit.msc


Step 3. In the Local Group Policy Editor window, navigate to the following path:-
User Configuration > Administrative Templates > System

Step 4. On the right side pane, double-click the policy “Prevent access to the command prompt.”

Step 5. Select the

Note: Under the “Options” section, you can use the drop-down menu to select whether you want to allow or disallow running batch files (.bat and .cmd) on your computer when Command Prompt is disabled.

Step 6. Click the

Once you have completed the above-mentioned steps, all users on your Windows 10 machine can still open the console. But, they will receive a “The command prompt has been disabled by your administrator” message with an option to press any key to terminate the session.
These changes are immediate, which means there is no need to restart your PC.
Also, depending on your configuration, Command Prompt scripts will no longer be processed.
If you want to allow access to Command Prompt on your PC, on Step 5, select the
How to Disable Command Prompt with Registry Editor?
Note: Before proceeding with Registry editing, you should create a backup of registry files.
This method is applicable to all versions of Windows 10, including the Windows 10 Home edition. To disable Command Prompt with Registry Editor, do the following steps:-
Step 1. Press
Step 2. Type the following and press
regedit


Step 3. Browse the following path:-
HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows

Step 4. Right-click on the

Step 5. Name the new key

Step 6. Now, right-click the

Step 7. Name the newly created DWORD

Step 8. Double-click the newly created DWORD and change the value from

Step 9. If you want to disable Command Prompt as well as batch files on your Windows 10 PC, change the newly created DWORD value from
Step 10. Click
Once you complete the above-mentioned steps, all users on your Windows 10 machine can still open the console. But, they will receive a “The command prompt has been disabled by your administrator” message with an option to press any key to terminate the session.
These changes are immediate, which means there is no need to restart your machine.
If you want to allow, the users to access Command Prompt, repeat the above steps and change the Value data to