Jan 15, 2007
My Digital Life Editorial Team

Disable and Turn Off (or Enable or Turn On) Data Execution Prevention (DEP) in Windows Vista

Data Execution Prevention (DEP) is security feature that first introduced in Windows XP Service Pack 2 (SP2) and is included in Windows XP Tablet PC Edition 2005, Windows Server 2003 Service Pack 1 (SP1) and Windows Vista, plus future operating system. DEP is intended to prevent an application or service from executing code from a non-executable memory region. DEP is enforced by hardware technology that detects code that is running from the default heap and the stack and raises an exception to terminate the process when execution occurs, and software-enforcer that prevent malicious code from taking advantage of exception-handling mechanisms in Windows. In short, DEP perform additional checks on memory to prevent malicious code or exploits from running on the system by shut down the process once detected.

However, Data Execution Prevention may accidentally shut down legitimate process from valid applications or services, particularly third-party installers used by software developers that release their products for download through the Web, or software programs that are less commonly used. To make thing worse, DEP normally does not or fails to display or show any warning or information or acknowledgment message prompt that can let you know that DEP has shut down a process, thus causing you unaware of the reason why your setup file cannot run, or why your computer cannot start a service and etc.

Good news is that you can disable or turn off Data Execution Prevention (DEP) globally in Windows Vista. To stop the DEP protection, launch an elevated command prompt shell with administrative priviledges and credentials (log on to Windows Vista with a user account with administrator rights, and then right click on Command Prompt icon and select “Run as Administrator, or turn off UAC). Then execute the following command:

bcdedit.exe /set {current} nx AlwaysOff

If you regret your decision and now wants to enable or turn back on the DEP protection for your Windows Vista, simply use the following command instead:

bcdedit.exe /set {current} nx AlwaysOn

98 Comments

  • i figured out a by a comment below. thank you for your help

  • well.. i ran the commant, DEP turned off but still the program is closed every time i try. so, i tried to reactivate DEP by the command, the terminal says “succesful etc” but DEP is still inactive. any solution?

  • This is a great function if you have a hacker constantly looking for ways to get at you. One chance and they turn it off … screen went blue. I did not know it was because they had disabled DEP. I did see many issues with Internet Explorer so I ran the Microsoft Fix It performance utility and it told me that DEP was disabled, but now fixed. Each time I ran the FixIt utility it said the same thing. I ran the command prompt and was finally able to access my web mail, etc. that for some reason previous to running the command, I was not able to access. While some people may not like it, it is a necessary option because of unscrupulous people.

  • F*** YOU Microsoft for building such a SHIT-HOLE of a software– DEP —
    unfortunately none of the above worked for me but thanks you all anyways….

    • I FEEL YOU MAN! AND SHARE THOSE EXACT WORDS, fucking idiots microsoft, I refuse to reinstall windows since then I would have 3 weeks of work to get all programs running back. Is there an update with this DERP shit I can just remove?

  • wooow thanx guys for this!!!!!!!!!!!!, i had just bought a new notebook for $849 and every time when i wanted tot start windows explorer it gave an error message. but when i typed this: bcdedit.exe /set {current} nx AlwaysOff in cmd with admin rights. and restart my computer, it runned normally like it used to be!!!!!!! my computer is not vista but windows 7 but it worked! thank you soo much!! excuse me for my bad english i’m dutch:D

  • Thanks for this
    The thread with experiences helped sort this out
    new commands to study :D

    bcdedit /set nx AlwaysOff = (mode 0)
    bcdedit /set nx AlwaysOn = (mode 1)
    bcdedit /set nx OptIn = (mode 2)
    bcdedit /set nx OptOut = (mode 3)

    wmic OS Get DataExecutionPrevention_SupportPolicy
    returns current level

    Dont forget to reboot after a bcdedit change for it to take effect :D

    /Dhurgan

  • hello,

    Secure changes, do this :

    Duplicate command, which displays the menu on startup (30 seconds please) and which can also have different options to launch the same Windows installation. Remember to change the title displayed.

    I let the author of this blog to explain the options bcdedit.exe.

    You can also use NeoSmart Technologies EasyBCD (2.1).

    thank you.

    • re hello,

      1))

      You can copy your existing VISTA or Windows 7 boot entry to another identical. Then you can change settings on the new entry to experiment. You will always have the first entry available, so it’s safe to play with.

      bcdedit /copy {current} /d “Windows 7 (Copy item + Option nx AlwaysOff !)”

      This command will give you a line :

      The entry was successfully copied to {12345678-1234-1234-1234-123456789012}.

      The {12345678-1234-1234-1234-123456789012} is the UUID of the new entry that the system just created. Yours will be different than mine here !

      The UUID is its identifier and you should use this to address the good entry.

      2))

      Practical example :

      bcdedit /set {12345678-1234-1234-1234-123456789012} nx AlwaysOff

      Thanks :-) ) !

  • WARNING – Disabling DEP per the above can permanently blue screen your Vista laptop. It caused my Dell Studio 1535 to blue screen on boot, even in safe mode. I had to use the Vista recovery disk to rebuild my BCD from the command line to fix it.

    If you want to try it and you're on a Vista laptop, I would print out the following KB on how to rebuild your BCD first, just in case your comp gets perma-blue screened too: http://support.microsoft.com/kb/927392

    • Just wanted to say thank you. I got exactly what you mentioned in the forum and tried everything possible to get my Dell XPS M1530 to boot with no success. I was about to completely reinstall Vista until I came across your post. I followed the supplied link and and completely rebuilt the MCB as mentioned. It worked and now my Laptop is back to normal!! The only downside is now I have no excuse for my wife to get a new laptop ;)

    • Correction to my reply, I meant BCD, not MCB :P

  • So this crap feature has been imposed on us with service pack 2 for XP. I turned it off in boot.ini but it is still running…(not running but the dialog shows up when I click on exe files) It takes 30 seconds to 1 minute to bring up that dialog so I can click run sometimes locking up my computer in the meantime. TOTAL CRAP!!!!!!!! This computer is ridiculously fast and with a brand new install of xp and nothing else installed or running (all unessentials killed in msconfig). How do I permanently kill this stupid "protection feature" permanently and immediately.

  • A few Vital things this article fails to mention which may save someone the time spent and horror experienced when I thought I could not Fix this

    DEP has 4 Modes (Admin can set them using Command Promt as Administrator)

    "bcdedit.exe /set {current} nx AlwaysOff" will set DEP to Mode 0

    DEP is Completely off, your computer is vulnerable and you cannot modify the DEP from your windows system settings as all of the options will be grayed out and the message at the bottom will tell you to use bcdedit.exe as Admin

    "bcdedit.exe /set {current} nx AlwaysOn" will set DEP to Mode 1

    DEP is Technically On, but you still cannot modify the DEP from your windows system settings as all of the options will be grayed out and the message at the bottom will tell you to use bcdedit.exe as Admin

    "bcdedit.exe /set {current} nx OptIn" will set DEP to Mode 2

    DEP is On and the DEP from your windows system settings as all of the options will be Set to Windows Programs Only (You can change this from the DEP window as normal)

    "bcdedit.exe /set {current} nx OptOut" will set DEP to Mode 3

    DEP is On and the DEP from your windows system settings as all of the options will be Set to All Programs except those that I Specify (You can change this from the DEP window as normal)

    If you are in the Command Prompt as Administrator the command

    wmic OS Get DataExecutionPrevention_SupportPolicy will display a value from 0-3 Indicating the current DEP Mode

    HERE'S THE KICKER that most DEP tutorials seem to leave out:

    If you're using a 64-bit versdion of windows the "bcdedit.exe /set {current} nx OptIn" command will work by default

    If you're using 32-bit Windows you must use:

    "bcdedit.exe /set {current} nx AlwaysOn" (Mode 1)

    AND THEN use "bcdedit.exe /set {current} nx OptIn" (Mode 2) in order to get your windows DEP settings to work again (not grayed out)

    • Hi Sir,

      So my computer the 64-bit version. DEP keeps on closing my game when I run it and it upsets me a lot. :( I tried the bcdedit.exe /set {current} nx AlwaysOff but it still closed it. How now?

    • Hey data execution prevention keeps closing a lot of programs that were previously fine. I've used Malwarebytes, Norton 360 and Spybot S&D to scan for any infections and none of them found anything. So using the command prompt as an administrator I used the command:

      "wmic OS Get DataExecutionPrevention_SupportPolicy"

      The policy was set to 1. I then used the command:

      “bcdedit.exe /set {current} nx AlwaysOff”

      It said the operation completed successfully. However when I then used the get support policy command again it still said it was set to 1 after i had used the always off command.

      Am I doing something wrong?

      • solved it forgot to reboot between commands duuuuuuuuuh -_____-

    • Maaaaaaaan thanks , so many thanks !

  • hey, this sucks balls

    I typed bcdedit /set {current} nx AlwaysOn (btw I memeorized this i'm so excited)

    and it said succesfully done, after restarting my computer the game still crashes

    • @counterstrikesource player:

      You have to type "Always OFFFFFFFFF" not ON!

  • I wanted to install Ragnarok online, but the program kept immediately shutting down, it alsos made me constantly crash on some games (Dead Space 2, which i couldn't finish because of this shit). Thanks to you, i turned off this pure DEP shit and now everything's workin, so all this to say thank you :)

  • i wanted to access http://57.228.106.142:7779/forms90/f90servlet?con… in windows 7

    which was not working

    and ran this command

    bcdedit.exe /set {current} nx AlwaysOff

    and it worked

  • please remove this dep from my computer

  • doesnt work on vista home premium. /set is an unknown command

    • It worked for me, and I have Vista Home Premium. Make sure you typed it all in word for word correctly. For example, there's no space between AlwaysOff.

  • I had big problems with a super-secure site: As soon as I logged in, IE8 was closed by DEP.

    I had tried all the correcting procedures described by Microsoft, to no avail. But when I tried your advice, IT WORKED!

    Thanks a lot!!

    May I confess that I was disappointed at the beginning, because nothing happened. I didn't know that a reboot was required for the changes to take effect. It was only after that that it worked. My feelings were the same as those of Adrian (#58 & 59), whom I read only after completion of the changes. May be you should add that vital final step, which laymen like me may not be aware of.

  • I've an Inspiron 1545 notebook and experienced the same problem, which NOT affects x64 and IA64-based OSes.

    Disabling DEP on a x86-based Windows machine may cause the system to fail.

    Both Dell and M$ didn't provide a fix for this issue at the time, though I'm expecting for a workaround which definitely prevents any x86-based Windows OS to crash after turning off the DEP feature.

  • what is the command propmt icon can someone tell me plzzzzzzzzzzzzzzzzzzzzzzz

  • i dont understand wen u said i have to log on to vista how do i do that

  • so it wont let me make an exception for my game planet shift.I turned it off and it works but i dont want to leave it off, could som1 tell me y it wont let me make an exception and how to force it to. It tells me pslaunch must run with des enabled

  • [...] disabling DEP with BCEDIT it'd be the first i've heard an i7 requiring it though. __________________ VBA-M | Xtemu | [...]

  • The advice given in this article is PERFECT.

    Does exactly what it claims.

    Thanks

    Ripp

  • The advice given in this article is stupid and dangerous – if one application doesn't play nice, you don't throw the security baby out with the bathwater by setting nx to AlwaysOff. Best practice is to set nx to OptOut – this leaves DEP working by default for all processes apart from those on the exemption list under Computer|Properties|Advanced System Settings|Advanced|Performance|Data Execution Prevention. All you've got to do is add your badly behaving baby to this list and you haven't exposed your entire system to the types of vulnerabilities DEP prevents.

  • worked perfectly in my copy of Windows 7.

    piece of cake to for all you dip sticks that AREN'T following the instructions.

  • To all the people who cant get it to work, You're probably running command prompt as yourself. You must right click and click "Run as administrator" Even if you are on the admin file it wont work unless you do that.

  • I disabled it for a game. It does not work well anyway. I have tried twice (& restarted twice) to turn it back on and it won't.

  • Worked perfectly for me.

    For those who it failed for, be sure to right-click RUN AS ADMINISTRATOR when you open the command prompt. If you do this successfully the title bar should say Administrator, also the path should be C:WindowsSystem32.

    NB Being logged in as an Administrator is not the same thing. And it will still say 'the command executed successfully' even when it hasn't. You must run the command prompt in the elevated environment.

  • DONT WASTE YOUR TIME WITH THIS SHIT, IT DOESNT WORK AT ALL

  • DON'T WASTE YOUR TIME WITH THIS SHIT, IT DOESN'T WORK AT ALL

  • Well – the VITAL final part of the exercise … is the REBOOT. Then it takes effect!

  • I am afraid that switch does not work. The command instruction executed successfully, but when I then used your tip to check the settings – nothing had changed.

    I need to turn this damned thing off as it constantly causes all my 4 browsers to crash.I have an image file of my C: partition to rstore if need be.

    Adrian

  • it does not work

  • omg i followed your instructions and it didnt work, then i found out how to do it the normal way through selecting certain programs for DEP to ignor but it wont let me put a check on either box and i think its becuase of the command prompt. i tried to set it back on again and it said it couldnt do it acces deinied or something. HELP!!

  • its still not letting me publish i have got to the part of pasting – bcdedit.exe /set {current} nx AlwaysOff – in but were do i go from there? there isnt anything saying update or whatever

  • were is this command prompt etc

  • [...] Data Execution Prevention (DEP) is disabled either in the BIOS or in the operating system. [...]

  • DUDE YOU ARE AWSOME THANKS SOOOO SOOOO MUCH

  • wow! thanks! it actually worked for me Vista Ultimate! Now, i can play Starcraft again! LOL

Pages: 1 2

Leave a comment

Notify me of followup comments via e-mail. You can also subscribe without commenting.

Subscribe

Free email subscriptions
Get latest updates in email for free:

Translate This Page