Enable, Disable Data Execution Prevention (DEP) in Windows 10/8/7

We have already seen how Data Execution Preventiona security feature can help prevent damage to your computer from viruses and other security threats. Harmful programs who try to attack Windows by attempting to execute code from system memory locations reserved for Windows and other authorized programs, are stopped. These types of attacks can harm your programs and files. DEP can help protect your computer by monitoring your programs to make sure that they use system memory safely. If DEP notices a program on your computer using memory incorrectly, it closes the program and notifies you. It is as such a security feature.

While it is not recommended, you may have your reasons for wanting to disable Data Execution Prevention on your Windows computer. Lets us see how to disable DEP in Windows 10/8/7 using the bcdedit.exe tool.

Disable Data Execution Prevention

In Windows 7, type cmd in Start Search. Right click on search results ‘cmd’ and click on Run as Administrator. Windows 10/8 users can also open an elevated command prompt window via the WinX menu.

Then, copy paste the following and hit Enter:

bcdedit.exe /set {current} nx AlwaysOff

cmd off

Reboot.

You will find that Data Execution Prevention has been disable on your Windows computer. You may then, if you wish, verify the status of Data Execution Prevention feature on your system.

Enable Data Execution Prevention

To enable back DEP, type the following in an elevated command prompt and hit Enter:

bcdedit.exe /set {current} nx AlwaysOn

cmd oon

This will enable back Data Execution Prevention.

See this if you receive The boot configuration data could not be opened message.

In the next few days, we will also show you how to:
  1. Enable or Disable Data Execution Prevention (DEP) for Internet Explorer only
  2. Turn Off or On Data Execution Prevention (DEP) for Individual Programs.
Posted by on , in Category Windows with Tags
Anand Khanse is the Admin of TheWindowsClub.com, a 10-year Microsoft MVP Awardee in Windows (2006-16) & a Windows Insider MVP. Please read the entire post & the comments first, create a System Restore Point before making any changes to your system & be careful about any 3rd-party offers while installing freeware.

39 Comments

  1. maxxxem

    Thank you!

  2. Kalpesh Parmar

    I followed your command on cmd with ‘open as admin”..But it shows “An error has occurred setting the element data.The value is protected by Secure booy policy and cannot be modified or deleted.”

  3. Jorge Carniel

    Thank you so much!

  4. thejynxed

    If you’re using Windows 8 or a UEFI boot instead of BIOS, you have to disable the Secure Boot function before this will work.

  5. James

    Hi, unfortunately when I type in “bcdedit.exe /set {current} nx AlwaysOff” it responds with “The boot configuration data store could not be opened. Access denied.” how do i fix this?

  6. Vinz

    how to fix always enable Dep? i do all the right ways to enable again my DEP by typing this bcdedit.exe /set {current} nx AlwaysOn then restart. after that my DEP still disabled :< Im using windows 7 ultimate

  7. Vinz

    how to fix always enable Dep? i do all the right ways to enable again my
    DEP by typing this bcdedit.exe /set {current} nx AlwaysOn then restart.
    after that i restarted pc and my DEP still disabled :< Im using windows 7 ultimate

  8. Tbone

    Thanks this fixed an issue I had with DEP and Windows Server 2012r2

  9. Mantas Tipo

    i have problem i open cmd on administrator then i copy that bcdedit.exe always on …. but then when i restart pc i go to computer properties advanced , then options and data execution prevention then it says if you want use this options you need to be computer administrator and use bcdedit.exe file and then search for microsoft base in internet help me plz it was on windowns 7

  10. Mantas Tipo

    yes this problem is to me too on windows 7 who can help us plz

  11. Jason Kustra

    Very helpful and very easy. Thank you!

  12. Sarp Karaca

    the boot configuration data store could not be opened access is denied

  13. Dalton DuPaul

    The boot configuration data store could not be opened.
    The system cannot find the file specified.

    Any Suggestions?

  14. Guest

    You have to run the command prompt as an administrator. Open the start menu, type CMD in the search field, and wait for cmd to pop up. Right click CMD and select “Run as Administrator.”

  15. Washbourne

    You have to run the command prompt as an administrator. Open the start
    menu, type CMD in the search field, and wait for cmd to pop up. Right
    click CMD and select “Run as Administrator.” This will solve it.

  16. Eriwanto Panjaitan

    To enable the options back, you must run this code on command prompt with administrator access

    type bcdedit.exe /set {current} nx AlwaysOn, press enter
    then type bcdedit.exe /set {current} nx optin, press enter

    restart PC to take affect

    more information here:

    http://answers.microsoft.com/en-us/windows/forum/windows_vista-performance/how-to-enable-dep-options-mine-are-grey-and-i-cant/2663dc18-72de-4729-b9ef-de398a7ca756

  17. Carlos Junior

    Just run it as administrator =)

  18. wizz ahmed

    access denied when i type those command in windows 8.1

  19. Saran Sara

    Data Execution Prevention Options Not Available Or Data Execution Prevention Choosing Options hided…if you want i send the image your mail ID…please reply me…..

  20. fotis

    i try this one but he tell me this…http://prntscr.com/5hipeu any help?

  21. Please see: forum.thewindowsclub.com/windows-tips-tutorials-articles/36510-fix-boot-configuration-data-could-not-opened.html

  22. Shahab

    It dosen,t work for me plzzz help>>>

  23. Some Guy

    So i have DEP enabled i think and i go to Control Panel/System Properties/System/Advanced system settings/ and clik on the advanced tab and then go to performace and click settings. i proceed to go to the Data Execution Prevention section and it wont let me change anything inside of there! i need to add programs to it but it won let me!

  24. Asiankid29

    Mine says The boot Configuration data store could not be opened Access denied. Help please?

  25. Jeffrey Davis

    And if that fails (AND your system is based on EFI rather than a more traditional BIOS setup), temporarily flip the switch on Secure Boot, make the changes and restart. Once back up, flip the switch on Secure Boot and you’re done!

    Additionally, if the use of the {current} modifier gives you errors, simply edit it out and try again, like so:

    bcdedit.exe /set nx optin
    bcdedit.exe /set nx AlwaysOff

    That’s what I had to do when I started using the Windows 10 Insider beta as my primary OS. Anyway, hope that helps anyone.

  26. Patryk Marchlewski

    I love u mate. 😀 u help me a lot 🙂 i fight with that almost hour 🙂 God bless u

  27. Ben Pope

    I wish I had a normal problem to fix so be thankful if you have a solid no or yes from your computer. Mine says it performs the bcedit operation but if I check it didn’t . Reboot its still off. Its like working with a guy that don’t listen. Just shakes their head and says yea yea yea, I got it. Never actually does anything you tell them though.

  28. Suomi A

    bcdedit.exe /set nx optin
    bcdedit.exe /set nx AlwaysOff windows 10

  29. Suomi A

    perfect my friend, works first time!

  30. wildflowerz

    I get the message ” a problem has caused the program to close”, i dont know what is blocking this particular program from running. I have already added it to DEP and it still dont run correctly..please help

  31. naemem

    it gets me an error:
    The boot configuration data store could not be opened. Access is denied.

    HELP

  32. dada gunda

    Thank you very much. This method worked fine for me on Dell Latitude E6400 laptop. Spent two days to find correct solution. Thanks again.

  33. Hoover1979

    I will name my first born after you!

  34. Pistolprinsen

    Is there a way to read the current status of DEP?

  35. Tanzeel Khan

    I get this error.
    The integer data is not valid as specified.
    Run “bcdedit /?” for command line assistance.
    The parameter is incorrect.

  36. Yuki_Sakuma

    I did the “bcdedit.exe /set {current} nx AlwaysOn” and “operation completed successfully” but DEP radio buttons are still grayed out.
    Help I am using Windows 7 x64 Pro

  37. sisslesticks

    Great post – Thank you.

Leave a Reply

Your email address will not be published. Required fields are marked *


1 + 1 =