Helping people with computers... one answer at a time.

Data Execution Prevention, or DEP, can prevent certain types of malware exploits. Unfortunately not all programs are compatible with DEP.

How do I get rid of Data Execution Prevention? Such a pain. It wouldn't allow me to view photos inside a photo folder ... I followed the route given by the "crash message" but I want it off my machine. Any ideas?

First let's be clear: Data Execution Prevention, or DEP, isn't something you "remove" or "get off your machine". It's simply a feature that can be turned on or off, or be configured.

I'll show you how to turn it off, but then I'll tell you why you shouldn't and what you should do instead to solve your problem.

What is DEP?

Start by realizing that as far as your computer is concerned, everything is just numbers. The text you're seeing? That's all stored as numbers with each number representing a different letter or character. Programs that you run? Numbers too: the instructions that tell the computer what to do are simply numbers.

From that example we can draw an important distinction: there's "code", or the instructions that tell a computer what to do, and there's "data", the information that the computer works on. But both code and data are stored as numbers.

Now, what hackers and virus writers have been able to do is exploit unpatched vulnerabilities that allow them to a) put what they want into data, and then b) trick the computer into executing that data as if it were code. That's one way they gain control of a machine and infect or otherwise compromise the machine.

Data Execution Prevention is exactly what it sounds like: the operating system, using either hardware, software or both, depending on the processor's capabilities, traps the attempt to execute data as if it were code. It's a very effective technique at blocking malware even if the vulnerability being exploited hasn't even been publicly exposed yet.

So what's the problem?

Some legitimate programs execute data as if it were code on purpose. Without getting into a lot of geeky details, it's sometimes an effective way to write very efficient code. If I'm not mistaken, older versions of Windows did something very similar to speed up graphics operations, for example. Since you mention viewing pictures, I'm guessing you were using an older version of IrfanView which was also known to do this.

Turning Off DEP

You can, if you like, turn off DEP completely.

  • Right click on My Computer

  • Click on Properties

  • Click on the Advanced tab

  • Click on the Settings button in the Performance section

  • Click on the Data Execution Prevention tab

At this point you should be looking at a dialog much like this one:

Data Execution Prevention Options

Select the item labeled "Turn on DEP for essential Windows programs and services only". This, effectively turns off DEP for everything else. Your image viewer should now work.

"If you have a program you know is legitimate that happens to cause DEP errors, you can add it to the list of exceptions."

But as I said at the beginning, in my opinion, this isn't what you should do.

Configure Exceptions to DEP

If you have a program you know is legitimate that happens to cause DEP errors, you can add it to the list of exceptions.

As you can see in the image above, the default DEP setting is to "Turn on DEP for all programs and services except those I select:". So, a much better way to get any legitimate program causing DEP errors to work again is to add that program to the exception list.

Click on the Add... button. Now, locate the program's ".exe" file. I don't happen to have IrfanView, but I'll use Foxit Software's PDF reader as a random example:

Specifying a DEP Exception

In this example the program was located in " C:\Program Files\Foxit Software\Foxit Reader\Foxit Reader.exe". The program you're looking for will, of course, be elsewhere, but most likely somewhere within "C:\Program Files".

The result should look something like this:

Data Execution Prevention Options with exception added

You can see that the program I specified has been added to the list of exceptions. It will not be protected by DEP, but everything else in your system will be.

That's a much safer way to run.

Article C3053 - June 11, 2007

Leo Leo A. Notenboom has been playing with computers since he was required to take a programming class in 1976. An 18 year career as a programmer at Microsoft soon followed. After "retiring" in 2001, Leo started Ask Leo! in 2003 as a place for answers to common computer and technical questions. More about Leo.

Not what you needed?

Recent Comments
182 Comments

I agree with all the above comments...this DEP program is absolutely ridiculous, even the windows web site says that if your anti-virus software didn't flag the program that DEP closed you probably are not under attack. This is just more B***S*** from windows.

Posted by: frustrated at October 20, 2011 7:09 AM

Turning off DEP, follow these steps exactly:
(note: you're doing this at your own risk)

Right click your Comand Prompt and RUN AS ADMIN.
Next type the following:
bcdedit.exe /set {current} nx AlwaysOff
Then hit Enter
you should see something saying that it was successful, now go ahead and close that up and restart your computer.
DEP is now off. to turn it back on just reverse the "AlwaysOff" to AlwaysOn".
Good Luck guys.

Posted by: that guy at November 6, 2011 9:30 AM

this is a typical scare tactic when another microsuck "update?" is introduced. this totally worthless program has reduced my puter to a desk ornament

Posted by: craig at November 14, 2011 5:31 PM

I'm still having problem with error message, "To help protect your Co. windows has closed this program. Internet Ex. has encountered a problem & needs to close." It only comes up when I'm on Ebay. I tried your advice & it's not working. I'm tryng to list auctions on Ebay. And it will not let me finish my listing. I need help ASAP. Thanks, Cathey

Id start turning off addins in Internet Explorer, or try a different browser like Firefox or Chrome.
Leo
15-Nov-2011
Posted by: Cathey Stovall at November 15, 2011 11:12 AM

in response to that guy, ive done that, and dep has been successfully turned off. But the program still isnt working. It says "An unknown program is preventing this action from being performed" (it used to be DEP). Any ideas what i could do?

Posted by: monferno at March 31, 2012 5:27 AM
Post a comment on "How do I turn off Data Execution Prevention errors?":





Remember Me?

(You may use HTML tags for style)

Before commenting, please...

  • READ THE ARTICLE. A comment that shows you didn't will be deleted and ignored.

  • Comment only on the article. Use the search box at the top of the page if you have a question about something else.

  • NO PERSONAL INFORMATION in the comment. No email addresses. No phone numbers. No physical addresses.

  • Anything that looks the least bit like spam will be deleted. Links to unrelated sites or links that appear to be primarily promotional will be deleted, or the comment will be deleted.

  • Don't ask me to recover lost passwords or hacked accounts. I can't. Those comments will be deleted.

  • I can't respond to every comment. And I can't vouch for the accuracy of others who do.

Please wait. Your comment is being processed ...