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

There are many ways to protect data from prying eyes, but as it turns out, preventing malicious deletion is nearly impossible. I'll review what to do.

In several posts, you had recommended TrueCrypt as a form of encryption. But my issue is that, even with encryption, your sensitive data will not be safe on the computer. Any person who has tried several times to crack the TrueCrypt volume could simply delete the file on disk, as TrueCrypt saves volumes as files on the disk. Is there any method of protecting sensitive (TrueCrypted) files on the computer from deletion?


Encrypting your data, as I'm sure you realize, protects it from being seen by people who shouldn't see it, but it does nothing at all to prevent that data from being erased.

In fact, it's nearly impossible to prevent someone with malicious intent from deleting data. Heck, it's impossible to prevent accidental deletion.

We might make it more difficult, but certainly not impossible.

Preventing Accidental Deletion

One approach to prevent accidental deletion is to simply mark the file as read-only:

Read Only Attribute on File Properties

Right-click on the file in Windows Explorer and click on Properties. Then set "Read-only" and you cannot delete the file through normal means. You also can't modify it, which limits its usefulness.

Of course, someone who logged into your account or did so as an administrator, could come along, remove the read-only attribute, and delete the file.

Limiting Access by User

Another approach is to set up multiple user accounts on the machine and restrict access to the file based on account:

File Security Settings

Click on the security tab in the file properties dialog that we opened above.

Windows file security settings are complex, but the basic idea here is to make sure that only those user accounts or groups that you want to have the Permissions necessary to delete the file, while all others do not.

And once again, someone logged into your account, or a system administrator, can easily revert or override any permissions that you set here and delete the file.

The Big Guns

Even if there were a way to truly protect a file from deletion within Windows, or even with some additional software, there's one tool that's guaranteed to delete the file no matter what.

Format C:

Anyone with physical access to the machine could very easily reformat the hard drive and erase everything on it. They could even go the extra mile and run something like DBan that would securely erase the hard drive so that data recovery techniques couldn't even find the file that you're trying to save. For that matter, they could also just physically destroy the drive.

No, there's simply no way to prevent someone with access to your machine from deleting a file.

Protecting Yourself

If you have a file that is critical and you think that someone would want to maliciously delete it for whatever reason, you need to take two specific steps:

  • Restrict access to the machine on which the data resides. Prevent individuals with malicious intent from accessing the machine, both physically and over any network. If you think about it, this is what banks and other secure data centers are all about - their data can simply not be directly accessed by any but a chosen few.

  • Backup. I hate to bring it up yet again, but this is the only way to ensure that you won't experience data loss if or when the data that you care about is deleted, accidentally or otherwise. And when you think about it, this is exactly what those secure data centers do as well. All that data that they control is also securely and regularly backed up.

If you want to keep your data from being seen by those who should not see it, encryption is one powerful solution. However, if you also need to protect yourself from data loss in any form, there's really only one answer.

Back up.

Article C4763 - March 12, 2011 « »

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?

arshad mehmood
March 12, 2011 5:35 PM

dear leo
what is ur viewpoint on using opera mini (its server is used to speed up browsing and convert pages to mobile format) for mobile banking? is it safe? all my banking details will b gng thru server. how effective will b https in this case???

I believe that https is INeffective in that the data is DECrypted on the opera servers and then re-encrypted to your bank. I believe that they even mention that they do not advise using mini for these types of transactions. It all depends on how much you trust the Opera folks with your banking data in the clear while it's there.

Tom R.
March 15, 2011 8:58 AM

All my machines have BIOS password enabled. This eliminates many potential attack scenarios. No adversary can do anything to the files on my machines, short of smashing them to bits with a big fat hammer ala Gallagher, because there's just no way to prevent all possible mayhem.

The major issue that a BIOS password does not protect against is a theif removing the hard drive and reading it on another machine.

March 15, 2011 10:11 AM

Well someone could open up the box and remove the CMOS battery thus clearing your password . Just a little more to worry about there. As you say though, the best way to protect sensitive data is to restrict access - even to go as far as on a thumb drive in a safe deposit box - but you have to weigh security vs convenience...

Mark J
March 15, 2011 10:22 AM

Removing your CMOS won't clear the Password any longer as it did in the past. The password is stored on flash memory. Of course, removing the hard drive allow anyone with the right knowledge to access all of your files. If anyone has physical access to your computer yor data isn't safe. This article is about preventing data loss and the only protection has and alwayys will be backup. To protect against people accessing your data, use encryption Truecrypt is excellent and it's free.

March 15, 2011 11:31 AM

If I understand, the problem here is to keep your secure data from being deleted. No way. None. Sorry about your luck.
WipeDisk, will erase EVERYTHING up to DOD standards, and there's lot's of ways to access a HD to start WipeDisk. It won't matter if you have a crack-proof password. it's not needed to delete. And it's not the only total disk eraser out there.
Backup everything to an external HD and keep it under your pillow. There's good HD tetrabyte-disks for under under $150 and these drives can be hidden under your pillow.

Ronald N.
March 15, 2011 12:33 PM

Only certain laptops will not reset the BIOS password by pulling the battery and pressing the power button. IBM may be one of them.

Also, google: "reset bios passwords", and you will be transported to tons of sites that give backdoor passwords. The companies provide them to techs and others to get into machines. This is common knowledge.

Just today I had to provide an email password to access a roadrunner account. It was trivial and we were in almost instantly.

As long as you can see the asterisks you are good as gold.

Well, I don't not know much more about passwords.

Never keep an "only copy" on Truecrypt or Bitlocker. If you do, you are in for total devastation sooner or later. You DO NOT want to be in this position.


Glenn P.
March 15, 2011 11:17 PM

Of course it would  help to save your file to a "write-once-only" media -- such as a CD-R, which, once written to, then becomes essentially "read-only". Then as long as the disc lasts and remains intact, neither it, nor the file on it, can be overwritten or erased.

The only way to "erase" your file in such as case would be to physically destroy the media (i.e., the compact disc) itself. (Microwaving it on "high" for three seconds will do the trick splendidly, should ever you need to dispose of personal or confidential information you've stored on a CD-R; however, even this  should be unnecessary, provided you've been sensible enough to encrypt the information before saving it.)

Charles Tilley
March 17, 2011 12:01 PM

I use BitLocker as my encryption method, plus have my backups on a 1TB HDD that only cost $59.99 @ Newegg, in a fireproof safe, plus another in my safety deposit box at the bank. HDD's are far less than $100.

So, even with BitLocker enabled, the drive can still be erased? Glad that I learned differently.


jim gassner
March 18, 2011 3:32 AM

Greetings, Enjoy your news letter and have a comment on TrueCrypt. The contents of the TrueCrypt volumes are not hidden from the Windows search companion on my XP SP3 machine. Any key word or file extension will pull them up and open them even if encrypted.

That's actually an excellent observation. When a truecrypt volume is mounted its contents are accessible in their unencrypted form. If you have the content indexer running it may index the content of your encrypted drive. While the documents thereon are NOT accessible if the volume is DISmounted, naturally they are if the volume is mounted. In addition there could be information in the index that you might not want others to see as well. I strongly recommend configuring the content indexer to NOT index any sensitive volumes, be they TrueCrypt or anything else.

June 5, 2011 4:04 AM

In the Preventing Accidental Deletion section you've written:

"One approach to prevent accidental deletion is to simply mark the file as read-only."

This does not protect against accidental deletion of the file at all.

Pressing [Delete] on a file that is marked as read-only will only prompt me to answer the question if I really want to move the file to the recycle bin. If I answer YES then the file will be moved to the recycle bin. Pressing [Shift][Delete] will only prompt me to answer the question if I really want to delete the file. If I answer YES then the file will be instantly deleted.

So if I'm not aware of the fact that I'm deleting a file that I really don't want to lose, then the file will be lost, even if it has been marked as read-only.

November 26, 2011 8:53 PM

I think using "My lock box" can actually be good as it lets u hide ur file so no one knows it's even there.
try it at:

If all it does is set the "hidden" attribute, it's still trivial to find.

Comments on this entry are closed.

If you have a question, start by using the search box up at the top of the page - there's a very good chance that your question has already been answered on Ask Leo!.

If you don't find your answer, head out to to ask your question.