Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

On Windows 11 or Windows 10, disable Command Prompt for a specific user with the Prevent access to the command prompt policy. Use Local Group Policy on supported Pro, Enterprise, or Education editions; on Windows Home, set the equivalent per-user registry value. The policy can also stop that user’s .cmd and .bat files from running, but it does not disable PowerShell or every other command-line tool.

Before you change the setting

  • Check the edition: Open Settings > System > About, or run winver. Microsoft documents this policy for Windows 10 version 2004 and later and Windows 11 version 21H2 and later on Pro, Enterprise, Education, and IoT Enterprise editions. Windows Home does not include Local Group Policy Editor by default. Microsoft’s policy documentation lists the supported editions and versions.
  • Choose the intended account: This is a user-scoped restriction, not a device-wide lock. A setting made for one profile does not automatically apply to another account.
  • Check for dependencies: The policy can affect batch files used for sign-in, sign-out, startup, shutdown, maintenance, or Remote Desktop Services. Confirm that the affected user or device does not rely on them before enabling it.
  • Check management ownership: On a work- or school-managed PC, Group Policy, Intune, or another MDM service may control or overwrite local settings. Ask the administrator to change the policy centrally.
  • Keep a recovery route: Have access to another administrator account or a working registry-editing method before restricting an administrator’s own profile. If editing the registry, back it up first.

Disable Command Prompt with Group Policy

Use this method on supported Windows Pro, Enterprise, and Education editions. Sign in as the user who should lose access, or have an administrator configure the policy for the appropriate user.

  1. Press Windows + R, type gpedit.msc, and press Enter.
  2. In Local Group Policy Editor, open User Configuration > Administrative Templates > System.
  3. Open Prevent access to the command prompt.
  4. Select Enabled, then choose Apply and OK.
  5. Review any option in the policy dialog concerning whether command scripts can run. The wording or availability can vary by Windows build; Microsoft documents that the policy governs both interactive Cmd.exe use and whether .cmd and .bat files can run.
  6. Sign out and back in, or refresh policy, then test by opening Command Prompt from Start or Run.

For a managed PC where policy has not refreshed, an administrator can run gpupdate /force in an elevated command or scripting environment. Microsoft documents this command as a manual Group Policy refresh in its policy refresh guidance.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Disable Command Prompt on Windows Home with the registry

When gpedit.msc is unavailable, use the documented policy registry mapping. This changes only the current user because the key is under HKEY_CURRENT_USER.

#1 Best Overall
Sale
Nulaxy Ergonomic Adjustable Laptop Stand for Desk, Dual Foldable Computer Riser with Advanced Heat-Vent, Heavy-Duty Portable Notebook Holder for Posture Correction, Compatible with Mac 10-16" Laptops
  • Ergonomic Posture Correction: Designed to elevate your laptop to the perfect eye level, this adjustable laptop stand significantly reduces neck, shoulder, and spinal fatigue. Transform your desk into a healthier workstation, ideal for long hours of typing, Zoom meetings, or gaming.
  • Unshakable Dual-Rod Stability: Unlike single-hinge models, our stand features a highly engineered dual-support rod mechanism. It perfectly distributes weight to ensure a 100% wobble-free typing experience, safely supporting heavy-duty devices up to 22 lbs (10kg).
  • Advanced Thermal Cooling Panel: Maximize your device's performance. The unique geometric heat-vent design on the upper panel provides superior airflow compared to standard solid stands. This continuous heat dissipation prevents your laptop from thermal throttling and hardware damage during intensive tasks.
  • Universal 10-16” Compatibility: A versatile computer riser that seamlessly fits all 10 to 16-inch laptops. Broadly compatible with MacBook Pro/Air, Dell XPS, HP, Lenovo, ASUS, Chromebook, and large gaming laptops. The anti-slip silicone pads firmly grip your device and protect it from scratches.
  • Foldable, Portable & Ready to Go: Maximize your productivity anywhere. The dual-foldable design allows the stand to collapse completely flat in seconds. Easily slip it into your backpack or briefcase, making it the ultimate portable office accessory for business trips, cafes, or hybrid work setups.
  1. Press Windows + R, type regedit, press Enter, and approve the User Account Control prompt.
  2. Navigate to HKEY_CURRENT_USERSoftwarePoliciesMicrosoftWindowsSystem. If one or more keys in that path are missing, create the missing keys.
  3. In the System key, create a DWORD (32-bit) Value named DisableCMD.
  4. Open DisableCMD, set Value data to 1, and select OK.
  5. Sign out and back in, or restart Windows, then test Command Prompt.

Microsoft documents the DisableCMD policy and its registry mapping in the Policy CSP reference. Its policy is user-scoped; a value under HKEY_CURRENT_USER therefore applies to the profile in which you set it.

Set the registry value with a command

If another shell is available, run this in PowerShell or another suitable administrative scripting environment for the current user:

Rank #2
Sale
BESIGN LS03 Aluminum Laptop Stand, Ergonomic Detachable Computer Stand, Notebook Riser, Laptop Mount Compatible with Air, Pro, Dell, HP, Lenovo More 10-15.6" Laptops, Silver
  • Broad Compatibility: Besign LS03 Laptop Mount is compatible with all laptops from 10''-15.6'', such as Air 13, Pro 13 / 15 / 2018 / 2017 / 2016, Lenovo ThinkPad, Dell, HP, ASUS, Chromebook, and other notebooks.
  • Ergonomic Design: This LS03 Laptop Stand could elevate your laptop by 6’’ to a perfect viewing level, help you improve your posture and reduce neck and shoulder pain. This laptop stand is super easy to detach and assemble.
  • Stable And Protective: This laptop stand is made of premium Aluminum alloy, it is sturdy, support up to 8.8 lbs(4kg), no worry any wobble at all; the rubber on the holder hands sticks tightly, ensure your laptop stable on the stand and prevent any scratches.
  • Keep Laptop Cool: the open aluminum design provides good ventilation and airflow to prevent your laptop from overheating. It folds flat if you need to store it, create extra space on your desk and keep your desk clean and organized.
  • Easy to Use: thanks to the detachable design, you could assemble it very easily it 3 steps.
reg add "HKCUSoftwarePoliciesMicrosoftWindowsSystem" /v DisableCMD /t REG_DWORD /d 1 /f

This command writes the same current-user value as the Registry Editor method. It does not target another account’s profile.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What the restriction blocks—and what it does not

The setting targets the traditional Windows Command Prompt executable, cmd.exe. Microsoft says it also determines whether .cmd and .bat files can run for the affected user. A policy message should appear when that user tries to open a command window.

Rank #3
Sale
LOXP Adjustable Laptop Stand, Computer Stand with 360 Rotating Base
  • ✔️[Foldabe & Protable] - Foldable laptop stand for desk & Protable computer stand, It combines the advantages of market brackets, convenient travel laptop stand. Easy to use. Suitable for working at home, office and outdoor, improve comfort.
  • ✔️[360°Rotation] - The computer stand with 360° rotating base, 360° rotation connected with the base is more flexible, the computer stand allows you to rotate the laptop to any angle.
  • ✔️[Stable & Durable] - The Computer stand is made of one-piece fiber metal material, which is more durable and stable than ordinary aluminum alloy computer stands. The upgraded rotating base makes the stand performance more stable, and the non-slip silicone protects the laptop from sliding.Only supports laptops up to 16 inches.
  • ✔️[Ergonmic Desing] - You can freely adjust the height and angle of the laptop stand to keep it at eye level, which helps to reduce the pressure on your body while working. Whether sitting or standing, there is a comfortable angle.
  • ✔️[Wide Compatibility] - Our laptop stand is compatible with all laptops from 10-16 inches, such as MacBook Air/Pro, Google PixelBook, Dell XPS, HP, ASUS, Lenovo ThinkPad, Acer, Chromebook and Microsoft Surface, etc. It is an ideal companion for computer workers.

It is not a universal command-line lockdown. It does not by itself disable PowerShell, PowerShell 7, Windows Terminal, Python, Git Bash, Cygwin, or other shells. Nor does applying it to one profile restrict a separate account that has not received the policy. A user who can administer the PC may also be able to undo local restrictions.

If the requirement is to restrict applications and scripts more broadly, consider application-control policies rather than treating this setting as a security boundary. Microsoft describes AppLocker as controlling executable files, scripts, Windows Installer files, DLLs, packaged apps, and packaged app installers. App Control for Business provides broader application-control capabilities, including control over scripts and command-line batch files. These approaches require careful planning and testing; Microsoft cautions that AppLocker is defense-in-depth, not a complete security boundary against a local administrator. See its AppLocker security considerations.

Rank #4
Gogoonike Adjustable Laptop Stand for Desk, Metal Laptop Riser Holder
  • 【Adjustable & Ergonomic】:This laptop stand can be adjusted to a comfortable height and angle according to your actual needs, letting you fix posture and reduce your neck fatigue, back pain and eye strain. Very comfortable for working in home, office and outdoor.
  • 【Sturdy & Protective】 :Made of sturdy metal, it can support up to 17.6 lbs (8kg) weight on top; With 2 rubber mats on the hook and anti-skid silicone pads on top & bottom, it can secure your laptop in place and maximum protect your device from scratches and sliding. Moreover, smooth edges will never hurt your hands.
  • 【Heat Dissipation】 :The top of the laptop stand is designed with multiple ventilation holes. The open design offers greater ventilation and more airflow to cool your laptop during operation other than it just lays flat on the table.
  • 【Portable & Foldable】:The foldable design allows you to easily slip it in your backpack. Ideal for people who travel for business a lot.
  • 【Broad Compatibility】:Our desktop book stand is compatible with all laptops from 10-15.6 inches, such as MacBook Air/ Pro, Google Pixelbook, Dell XPS, HP, ASUS, Lenovo ThinkPad, Acer, Chromebook and Microsoft Surface, etc.Be your ideal companion in Home, Office & Outdoor.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Use central management for multiple devices

For company or school devices, deploy the user-scoped policy through domain Group Policy or an MDM platform such as Intune instead of editing each profile manually. Microsoft exposes it through the Policy CSP at ./User/Vendor/MSFT/Policy/Config/ADMX_ShellCommandPromptRegEditTools/DisableCMD. The ADMX-backed MDM setting requires a string-formatted payload; SyncML configuration is an administrator task, not a beginner substitute for the local steps above. Central management also gives administrators a place to target user groups and roll back the change.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For a broader restriction, use AppLocker or App Control for Business with an administrator-defined rule set. AppLocker rules and enforcement settings need testing because overly broad rules can block legitimate applications. See Microsoft’s guidance on configuring AppLocker enforcement and rule and enforcement inheritance.

Best Value
Tonmom Adjustable Laptop Stand for Desk, Metal Foldable Laptop Riser
  • ✅【Adjustable & Ergonomic】:This laptop stand can be adjusted to a comfortable height and angle according to your actual needs, letting you fix posture and reduce your neck fatigue, back pain and eye strain. Very comfortable for working in home, office and outdoor.
  • ✅【Sturdy & Protective】 :Made of sturdy metal, it can support up to 17.6 lbs (8kg) weight on top; With 2 rubber mats on the hook and anti-skid silicone pads on top & bottom, it can secure your laptop in place and maximum protect your device from scratches and sliding. Moreover, smooth edges will never hurt your hands.
  • ✅【Heat Dissipation】 :The top of the laptop stand is designed with multiple ventilation holes. The open design offers greater ventilation and more airflow to cool your laptop during operation other than it just lays flat on the table.
  • ✅【Portable & Foldable】:The foldable design allows you to easily slip it in your backpack. Ideal for people who travel for business a lot.
  • ✅【Broad Compatibility】:Our laptop holder is compatible with all laptops from 10-17.3 inches, such as MacBook Air/ Pro, Google Pixelbook, Dell XPS, HP, ASUS, Lenovo ThinkPad, Acer, Chromebook and Microsoft Surface, etc.Be your ideal companion in Home, Office & Outdoor.

Troubleshoot a policy that does not work

  • gpedit.msc is missing: Windows Home does not include Local Group Policy Editor by default. Use the registry method instead; avoid unofficial Home-edition installers.
  • Command Prompt still opens: Confirm that the policy was set under User Configuration for the account being tested, then sign out and in or refresh policy. For the registry method, verify the HKEY_CURRENT_USER path, the exact value name DisableCMD, and the DWORD (32-bit) type with data 1.
  • A local change keeps reverting: A domain GPO or MDM policy may be authoritative. The administrator who manages that policy needs to make or remove the change.
  • Another terminal or shell still works: That is expected; the setting targets cmd.exe, not all shells. Broader application control requires a separately designed policy.
  • Batch jobs or scripts fail: Check whether they are .cmd or .bat files and whether the affected account depends on them. Microsoft warns specifically about sign-in, sign-out, startup, shutdown, and Remote Desktop Services scenarios.
  • You cannot undo it from the affected account: Use another administrator account, Registry Editor, PowerShell or another available shell if permitted. For a centrally managed PC, request a policy rollback from its administrator. Windows Recovery Environment or Safe Mode may be necessary if normal administrative tools are inaccessible.

Restore Command Prompt access

Undo the Group Policy setting

Return to User Configuration > Administrative Templates > System > Prevent access to the command prompt and choose Disabled or Not Configured. Apply the change, then sign out and back in or refresh policy. Microsoft states that with the policy disabled or not configured, users can run Cmd.exe and batch files normally.

Undo the registry setting

In Registry Editor, return to HKEY_CURRENT_USERSoftwarePoliciesMicrosoftWindowsSystem and change DisableCMD to 0, or delete only the DisableCMD value. Do not delete the entire System key unless you have confirmed it contains no other policy values that should remain.

To remove the value from the current user’s profile in another available shell, run:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
reg delete "HKCUSoftwarePoliciesMicrosoftWindowsSystem" /v DisableCMD /f

Then sign out and back in or restart Windows. On a managed device, a centrally assigned policy may reapply the restriction until its owner changes it.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.