Turn on or off DEP in Windows 11 – Quick Guide
In this article
Yes—you can enable or disable Data Execution Prevention (DEP) in Windows 11 using the System Properties dialog or PowerShell commands.
What You'll Need
- A Windows 11 PC with administrator privileges.
- Access to the built‑in Settings app or PowerShell.
- Basic familiarity with navigating Windows menus.
Step-by-Step
- Open System Properties. Press Windows+Pause/Break or right‑click the Start button, choose System, then click Advanced system settings on the right side. The classic System Properties window appears.
- Navigate to the DEP tab. In the System Properties dialog, select the Advanced tab, then click the Settings… button under the Performance section. A new window titled Performance Options opens; switch to the Data Execution Prevention tab.
-
Choose the desired mode.
- Turn on DEP for essential Windows programs and services only – this is the default safe setting.
- Turn on DEP for all programs and services except those you select – enables DEP system‑wide but lets you whitelist specific legacy applications.
- Restart your computer. DEP changes take effect after a reboot. Save any work, then choose Start > Power > Restart.
If you prefer a command‑line approach, follow these steps instead:
- Open PowerShell as Administrator. Right‑click the Start button, select Windows Terminal (Admin) or search for PowerShell, right‑click the result, and choose Run as administrator.
-
Check the current DEP status. Type the following command and press Enter:
Get-ProcessMitigation -System
Look for theDEPline – it will showON(for the default) orOFFif it has been disabled. -
Enable DEP for the whole system. Run:
bcdedit /set {current} nx AlwaysOnThis tells the boot configuration to enforce DEP for all processes. -
Disable DEP (not recommended for most users). If you have a legacy game that crashes because of DEP, you can turn it off with:
bcdedit /set {current} nx AlwaysOffWarning: Disabling DEP reduces protection against buffer‑overflow attacks and should only be used temporarily for troubleshooting. - Apply the change. After issuing either command, restart the PC to let the boot loader apply the new setting.
Common Mistakes
- Changing the wrong boot entry. The
{current}identifier refers to the active OS entry. Using{default}or a different GUID can modify a different Windows installation, leaving the intended one unchanged. - Forgetting to run PowerShell as administrator. Without elevated rights the
bcdeditcommand fails silently, and no error is shown in the console. - Disabling DEP globally. Turning DEP off for all programs opens the system to memory‑corruption exploits. Most issues can be solved by whitelisting a single executable instead of disabling the whole feature.
- Skipping the reboot. DEP settings are read at boot time; failing to restart leaves the old policy active.
Tips
- Use the whitelist option ("Turn on DEP for all programs and services except those you select") to keep DEP active while allowing a known legacy app to run.
- When whitelisting, click the Add… button, browse to the executable, and confirm. Avoid adding entire folders—this can unintentionally expose unsafe code.
- Keep your system updated. Windows updates often include DEP‑related stability fixes that reduce the need for manual tweaks.
- If you rely on PowerShell scripts, add
Set-ProcessMitigation -Name "yourapp.exe" -Enable DEPto enforce DEP on a per‑process basis without altering the global policy. - Document any changes you make (date, reason, command used). This makes future troubleshooting easier, especially on shared or corporate PCs.
Troubleshooting
If DEP does not appear to be active after following the steps, try the following sequence.
- Confirm the setting in System Properties. Re‑open the DEP tab and verify that the radio button you chose is still selected.
- Run the PowerShell check again.
Get-ProcessMitigation -Systemshould now listDEP: ON(orOFFif you disabled it). - Check the boot configuration. In an elevated Command Prompt, type
bcdedit /enum {current}and look for the linenx. It should readAlwaysOnfor enabled DEP orAlwaysOfffor disabled. - Ensure no third‑party security software is overriding DEP. Some antivirus suites have their own memory‑protection modules that can mask the Windows setting. Temporarily disable the suite and test again.
- Update the BIOS/UEFI firmware. Certain older firmware versions disable hardware‑based DEP (NX‑bit) by default. Enter the BIOS setup (usually Delete or F2 at boot) and look for an option called "Execute Disable Bit" or "NX‑Enable"; set it to Enabled.
- Perform a clean boot. Use
msconfigto disable non‑Microsoft services and startup items, then restart. This isolates whether a third‑party driver is interfering with DEP. - Re‑apply the setting. If none of the above resolves the issue, repeat the PowerShell
bcdeditcommand, then runbcdedit /set {current} nx OptIn(the default state) and reboot.
If the problem persists after these checks, consider restoring the system to a point before DEP was altered, or contact Microsoft Support with the exact error messages you encounter.
Frequently Asked Questions
What does DEP actually protect against?
DEP prevents code from being executed in memory regions that are marked as data‑only, blocking many buffer‑overflow and heap‑spray attacks.
Can I enable DEP for a single program without affecting the whole system?
Yes. Use the System Properties whitelist or the PowerShell command Set-ProcessMitigation -Name "app.exe" -Enable DEP to apply DEP only to that executable.
Will turning off DEP improve game performance?
Disabling DEP may stop a game that crashes due to incompatibility, but it does not typically improve performance. Whitelisting the game is a safer alternative.
Is DEP the same as hardware‑based NX‑bit?
DEP uses the CPU’s NX (No‑Execute) feature when available. If the hardware does not support NX, Windows falls back to a software‑only implementation, which is less effective.
Do Windows updates reset DEP settings?
Major feature updates preserve the current DEP configuration. However, a clean reinstall of Windows will revert to the default "essential Windows programs only" setting.
Can I view which processes are currently being blocked by DEP?
Yes. In an elevated PowerShell window, run Get-ProcessMitigation without parameters to see a list of running processes and their DEP status.