How to Disable Command Prompt Access on Windows 10?

Command Prompt is a powerful tool in Windows 10 that allows users to execute various commands and scripts. However, it can also be a security risk, especially if it is used maliciously by someone with access to your computer. For this reason, you may want to disable Command Prompt access on your Windows 10 computer, either for specific users or for all users. In this article, we will guide you through the steps to disable Command Prompt access on Windows 10, so you can enhance the security of your computer and protect your data.

Disabling Command Prompt access is a straightforward process that can be done using the Group Policy Editor or the Registry Editor. Once disabled, users will not be able to access Command Prompt, either through the Start menu or by using keyboard shortcuts. This can be a useful security measure in a variety of scenarios, such as in public places where you want to limit access to your computer’s settings and features. In the following sections, we will explain how to disable Command Prompt access on Windows 10 using both the Group Policy Editor and the Registry Editor.

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 the Windows logo + R keys to open the Run dialog box.

Step 2. Type the following and press Enter from the keyboard to open the Local Group Policy Editor window:-

gpedit.msc
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 Enabled option.

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 Apply and then the OK button.

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, in Step 5, select the Not Configured option.

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 Windows Logo + R keys to open the Run dialog box.

Step 2. Type the following and press Enter from the keyboard to open the Registry Editor window:-

regedit

Step 3. Browse the following path:-

HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows

Step 4. Right-click on the Windows key and select the New > Key option.

Step 5. Name the new key System and press Enter from the keyboard.

Step 6. Now, right-click the System key, select New, and choose the DWORD (32-bit) Value option.

Step 7. Name the newly created DWORD DisableCMD.

Step 8. Double-click the newly created DWORD and change the value from 0 to 2 to disable Command Prompt while batch files will continue to run on the device.

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 0 to 1.

Step 10. Click OK.

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, users to access Command Prompt, repeat the above steps and change the Value data to 0 in Step 8 above.

Conclusion

In conclusion, while the Command Prompt can be a powerful tool in Windows 10, it can also pose a security risk. Disabling access to Command Prompt on your computer can help enhance its security and protect your data. The Group Policy Editor and Registry Editor are two methods you can use to disable Command Prompt access on your Windows 10 machine. The Group Policy Editor is the easiest option for those using Windows 10 Pro, while the Registry Editor method works for all versions of Windows 10, including the Home edition. Remember to take precautions, such as backing up registry files before editing them and choosing the appropriate option for your needs.

Leave a Reply