How to Disable DEP in Windows

Data Execution Prevention (DEP) is a security feature in Windows that helps protect your system from malicious programs and viruses by preventing code execution in certain memory areas. Although useful, DEP can sometimes cause conflicts with specific programs. If you need to temporarily disable DEP, here’s a step-by-step guide on how to do it.

Step 1: Open Command Prompt as Administrator

Changing DEP settings requires administrative privileges. To open Command Prompt with elevated permissions, follow these steps:

  • Press Win + S and type "cmd".
  • Find Command Prompt in the search results.
  • Right-click on it and select Run as administrator.

Step 2: Check Current DEP Settings

Before making changes, you can check which DEP settings are active. In Command Prompt, type the following command:

wmic OS Get DataExecutionPrevention_SupportPolicy

This will display one of four possible values:

  • 0 — DEP is disabled for all processes.
  • 1 — DEP is enabled only for essential Windows programs and services.
  • 2 — DEP is enabled for all programs and services.
  • 3 — DEP is enabled for all processes except those you manually specify as exceptions.

Step 3: Disable DEP via Command Prompt

To fully disable DEP, enter the following command and press Enter:

bcdedit.exe /set {current} nx AlwaysOff

If the command completes successfully, you will see a confirmation message. After this, restart your computer to apply the changes.

Step 4: Re-enable DEP if Needed

If you want to re-enable DEP, type the following command in Command Prompt:

bcdedit.exe /set {current} nx AlwaysOn

Remember to restart your computer to revert DEP to its original state.

Alternative Method: Disabling DEP via Control Panel

If you prefer using the graphical interface, try this method:

  1. Open Control Panel and go to System.
  2. Click on Advanced system settings on the left sidebar.
  3. Under the Advanced tab, click on Settings in the Performance section.
  4. In the Data Execution Prevention tab, you can choose Turn on DEP for all programs and services except those I select or Turn on DEP for essential Windows programs and services only.
  5. To add a program to the exceptions list, click Add, select the program, and save your changes.