Restricting CMD & Powershell
Last updated
Last updated
To disable Command Prompt (cmd.exe), follow these steps:
Open the Group Policy Editor:
Press Win + R
, type gpedit.msc
, and press Enter.
Navigate to the following path:
Find and configure the "Prevent access to the command prompt" policy:
Look for the policy "Prevent access to the command prompt" in the right-hand pane.
Double-click to open the settings window.
Set it to Enabled.
You can also configure the option to Disable the command prompt script processing if needed.
Click Apply and then OK.
This policy will prevent users from accessing the Command Prompt. If the user tries to launch it, they will see an error message.
To block PowerShell, follow these steps:
Open the Group Policy Editor:
Press Win + R
, type gpedit.msc
, and press Enter.
Navigate to the following path:
Find and configure the "Don't run specified Windows applications" policy:
Double-click on "Don't run specified Windows applications".
Set it to Enabled.
In the "List of disallowed applications", click on Show, then type powershell.exe
and powershell_ise.exe
in the list.
Click Apply and then OK.
This policy will prevent users from running PowerShell or the PowerShell ISE (Integrated Scripting Environment).