Skip to content

TechDirectArchive

Hands-on IT, Cloud, Security & DevOps Insights

  • Home
  • About
  • Advertise With US
  • Reviews
  • Contact
  • Toggle search form
Home » Windows » Disable Data Execution Prevention and determine that hardware DEP is available and configured

Disable Data Execution Prevention and determine that hardware DEP is available and configured

Posted on 27/01/202316/03/2023 Matthew By Matthew No Comments on Disable Data Execution Prevention and determine that hardware DEP is available and configured
Data Execution Prevention
Data Execution Prevention

Data Execution Prevention (DEP) is a security feature that helps protect a PC from certain types of security risks such as buffer overflow attacks and memory-based attacks. By exploiting a weakness in a program or system, these hacks may let malicious code execute on a computer. DEP works by designating some sections of memory as non-executable. This means that codes cannot be executed from these locations. This is accomplished by setting a specific bit in its page table entry called NX, which stands for No eXecute, or XD, which stands for eXecute Disabled. In this guide, you will learn how to Disable Data Execution Prevention, and how to determine that hardware DEP is available and configured on your PC.

The OS is responsible for setting the NX bit for the stack and heap memory locations. When a faulty program or malware attempts to execute code from an NX-marked memory page, the CPU will reject it and instead generate an interrupt, causing the OS to shut down the application. This can help prevent some sorts of attacks by making malicious code more difficult to execute. Here are other related posts: Windows Package Manager: How to install applications with Winget CLI, and how to disable modern standby on Windows 10 and 11.

Why should we disable Data Execution Prevention (DEP)?

There are certain situations where it may become necessary to disable Data Execution Prevention (DEP) in order to run certain programs or applications that may not be compatible with DEP. This can happen when a program or application tries to run code from an area of memory that DEP has marked as non-executable, causing the program or application to crash or malfunction.

In some cases, a software developer may have written the code in such a way that it does not comply with DEP, making the software incompatible with DEP. In these situations, turning off DEP may be necessary to run the software.

However, it is important to note that turning off DEP can leave your computer more vulnerable to security threats and should only be done as a last resort.

Another reason is that some applications or scripts may need to run from specific memory locations that DEP marks as non-executable.

How to turn on and turn off Data Execution Prevention (DEP) in Control Panel

Follow the steps below to turn on or turn off DEP support in Control Panel. Press the Windows key and search for Control Panel.

Open Control Panel
Open Control Panel

Click on System and Security and then on System from the Control Panel as shown below.

Open the System settings
Open the System settings

In the System settings, click on Advanced system settings.

Open the Advanced system settings
Open the Advanced system settings

In the Advanced tab, click on the Settings button in the Performance section.

Click the Performance Settings button
Click the Performance Settings button

Click the Data Execution Prevention tab, and on click “Turn on DEP for all programs and services except those I select.”

Select DEP support settings
Select DEP support settings

YOu can turn off DEP for an individual program. To do so, select the check box next to the program that you want to turn off DEP for, and then click OK.

If the program is not on the list, click Add. Browse to the Program Files folder, and find the executable file for the program (it will have an .exe file name extension), and then click Open.

Click OK, in the System Properties dialog box if it appears, and then click OK again. You might need to restart your computer for the changes to take effect.

How to turn off and turn on DEP support as Boot option via Command Prompt

There are other DEP settings that cannot be changed in the control panel; they can only be set as a boot option using the service program bcdedit in a command prompt with elevated rights.

Follow the steps below to edit the boot configuration file for DEP in recovery mode via the command prompt. Press “Windows key + I key” to open Settings, select System and click on Recovery from the right side.

Select Recovery in the System setting
Select Recovery in the System setting

Select the Restart now button next to the Advanced startup section and click Restart from the follow up prompt.

Select Advanced startup in Recovery
Click on Advanced startup in Recovery

The PC will restart, and show the Advanced options window. Select Troubleshoot from the options displayed, by using the arrow keys from your keyboard.

Select Troubleshoot
Click on Troubleshoot

Select Advanced options.

Select Advanced options
Select Advanced options

Choose Command Prompt.

Select Command Prompt
Select Command Prompt

Now, you can enter the following command according to DEP support settings to be enabled or disabled.

One option is to enable DEP support unconditionally. The DEP support options GUI is disabled in this mode, and no exceptions can be specified. Any DisableNX compatibility options will be disregarded as well.

 bcdedit /set {current} nx AlwaysOn

In contrast, the first option is to turn off DEP support completely. With this setting, like with the first option, the DEP support options GUI will also be turned off.

bcdedit /set {current} nx AlwaysOff

To return to one of the GUI switchable modes, use:

bcdedit /set {current} nx OptIn

For the workstation default, which enables DEP support for Windows essential programs and services, or:

bcdedit /set {current} nx OptOut

Enabling DEP support for all executable files as the server default. For the bcdedit command to take effect, the Windows PC must be restarted each time. The output of the following command will show the status (current) in each instance.

bcdedit /enum

How to confirm that hardware DEP is working in Windows via Command Prompt

You can use the Wmic command-line tool to examine the DEP settings. To determine whether hardware-enforced DEP is available, follow these steps:

Press the Windows key to open the Start menu, search for Command Prompt and click to open it.

Open Command Prompt
Open Command Prompt

On the command prompt. Type the command below and press ENTER.

wmic OS Get DataExecutionPrevention_Available 
Check DEP status
Check DEP status

If the output is “TRUE,” hardware-enforced DEP is available.

To determine the current DEP support policy, follow these steps. At the command prompt, type the command and press ENTER:

wmic OS Get DataExecutionPrevention_SupportPolicy 
Check DEP policy level
Check DEP policy level

The value returned will be 0, 1, 2 or 3. This value corresponds to one of the DEP support policies that are described in the table below.

DataExecutionPrevention_SupportPolicy property valuePolicy LevelDescription
2OptIn (default configuration)Only Windows system components and services have DEP applied
3OptOutDEP is enabled for all processes. Administrators can manually create a list of specific applications that do not have DEP applied
1AlwaysOnDEP is enabled for all processes
0AlwaysOffDEP is not enabled for any processes
Table source: Microsoft

I hope you find the post helpful. You have learned how to Disable Data Execution Prevention, and determine that hardware DEP is available and configured on your computer. If you have any questions, please leave a comment below.

Rate this post

Thank you for reading this post. Kindly share it with others.

  • Share on X (Opens in new window) X
  • Share on Reddit (Opens in new window) Reddit
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Facebook (Opens in new window) Facebook
  • Share on Pinterest (Opens in new window) Pinterest
  • Share on Tumblr (Opens in new window) Tumblr
  • Share on Telegram (Opens in new window) Telegram
  • Share on WhatsApp (Opens in new window) WhatsApp
  • Share on Mastodon (Opens in new window) Mastodon
  • Share on Bluesky (Opens in new window) Bluesky
  • Share on Threads (Opens in new window) Threads
  • Share on Nextdoor (Opens in new window) Nextdoor
Security | Vulnerability Scans and Assessment, Windows Tags:data, Microsoft Windows, security, Windows 10, Windows 11, Windows Server 2016

Post navigation

Previous Post:  How to Bundle MSIX Packages
Next Post: Fix macOS Apps opening on the wrong desktop

Related Posts

  • Featured image 1
    How to Disable Internet Explorer with Group Policy & Registry Windows
  • Safeguard Your PC Against Common Malware Entry Points
    Safeguard Your PC Against Common Malware Entry Points Security | Vulnerability Scans and Assessment
  • Windows Hello with fake fingerprints
    Security researchers bypass Windows Hello with fake fingerprints with Raspberry Pi 4 Security | Vulnerability Scans and Assessment
  • Featured image Unblock Microsoft Store
    How to Unblock Microsoft Store on Windows 11 Windows
  • Migrate RDS CALs
    How to Migrate RDS CALs Windows
  • How to create a Recovery Partition in Microsoft Windows
    How to create a Recovery Partition in Microsoft Windows 10/11 Windows

More Related Articles

Featured image 1 How to Disable Internet Explorer with Group Policy & Registry Windows
Safeguard Your PC Against Common Malware Entry Points Safeguard Your PC Against Common Malware Entry Points Security | Vulnerability Scans and Assessment
Windows Hello with fake fingerprints Security researchers bypass Windows Hello with fake fingerprints with Raspberry Pi 4 Security | Vulnerability Scans and Assessment
Featured image Unblock Microsoft Store How to Unblock Microsoft Store on Windows 11 Windows
Migrate RDS CALs How to Migrate RDS CALs Windows
How to create a Recovery Partition in Microsoft Windows How to create a Recovery Partition in Microsoft Windows 10/11 Windows

Leave a Reply Cancel reply

You must be logged in to post a comment.

Microsoft MVP

VEEAMLEGEND

vexpert-badge-stars-5

Virtual Background

GoogleNews

Categories

veeaam100

Veeam Vanguard

  • Screenshot 2020 05 19 at 18.54.21
    Unable to find File Explorer in the Group Policy Editor when resolving the security tab missing under properties Windows Server
  • maxresdefault
    How to add one or more external displays with your Mac Mac
  • article 1280x720.166f8634
    How to install DHCP role on Windows Server 2019 Windows Server
  • windows 10 technical preview windows 10 logo microsoft 97543 1920x1080
    How to Remove the All Apps Option from Windows Start Menu via GPO /Registry Windows
  • 10.0.17763.1 error
    Fix Windows 10 Setup 1809 build 10.0.17763.1 is not supported Error Windows Server
  • Hub Transport 1
    Hub Transport Server: Resolving ‘Failed to Reach Running Status’ Network | Monitoring
  • GRADLE FEATURE
    How to install Gradle on Ubuntu Linux
  • Webp.net resizeimage 7
    Create a new Azure Disk: How to create and attach an extra Disk to Azure Virtual Machine AWS/Azure/OpenShift

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,819 other subscribers
  • RSS - Posts
  • RSS - Comments
  • About
  • Authors
  • Write for us
  • Advertise with us
  • General Terms and Conditions
  • Privacy policy
  • Feedly
  • Telegram
  • Youtube
  • Facebook
  • Instagram
  • LinkedIn
  • Tumblr
  • Pinterest
  • Twitter
  • mastodon

Tags

Active Directory Azure Bitlocker Microsoft Windows PowerShell WDS Windows 10 Windows 11 Windows Deployment Services Windows Server 2016

Copyright © 2025 TechDirectArchive

 

Loading Comments...
 

You must be logged in to post a comment.