4

I have a file on NTFS that holds accumulated information that will take forever to recreate. I marked it as 'archive' and 'system', so that it would not be obvious to notice or mishandle, but what I really want is to put some kind of lock on it, so that deleting it would only be possible when providing a password or fulfilling some other condition.

Is there a tool that can help me? perhaps some hidden Windows feature?

HopelessN00b
  • 53,795
  • 33
  • 135
  • 209
Yuval
  • 217
  • 1
  • 6
  • 11
  • Is it not possible to simply make a backup of the file? – Zoredache May 04 '09 at 08:25
  • It is simple, and I really should do this. I guess because the file is updated at least once a day I'm more worried about it being deleted between backups. – Yuval May 04 '09 at 08:41

4 Answers4

13

Just remove modify permissions from anyone but the user account that creates the file. This kind of thing is exactly what NTFS rights are for.

Tomalak
  • 1,605
  • 4
  • 17
  • 32
  • can you elaborate on this please? – Yuval May 04 '09 at 08:40
  • 2
    I'm not sure how I would elaborate on "remove modify permissions". Just right-click the file and change the permissions accordingly. – Tomalak May 04 '09 at 09:30
  • Did you try this? Denying modify on the file has no effect, because the folder it's in is still writeable, so the file can be moved (to the Recycle Bin). – wqw Jan 21 '14 at 20:11
13

"accumulated information that will take forever to recreate" - the time to prepare a backup / restore procedure is right now. Don't wait until the file is somehow deleted or overwritten, or the disk fails. A proper backup strategy with proven (and tested) restore capability is a must.

gimel
  • 1,203
  • 8
  • 9
  • So true... and I'm on my way to do just that :-) Still, is there a way to prevent the file from being deleted? – Yuval May 04 '09 at 08:39
  • +1: For testing. Without confidence it can be recovered, the backup is just hope. – Richard May 04 '09 at 09:39
  • "write only" backups can be disappointing, but can help if you need a short backup time ;-) – gimel May 04 '09 at 10:29
  • I know backups are nice and all... But how do they prevent a file from being deleted (since this is what the OP is actually asking for)? – Tomalak May 04 '09 at 11:15
  • A backup doesn't prevent the file from being deleted, obviously, but if a file is truly that critical, a backup is equally so. – Eddie May 04 '09 at 15:21
3

Under NTFS you can alter the access rights for users and groups either at a folder level or at a file level.

Right click on a file or folder and go to the security tab. You can then remove users rights for deleting / modifying a file. Ensure you leave the administrator and administrators full rights. Also, if it on a domain ensure that both the local administrator and domain administrators have full access rights.

Toby Mills
  • 439
  • 3
  • 5
  • Just remember that there is no way to prevent a file from being deleted by ALL users - otherwise, you'd never be able to delete the file! Access permissions are best, but if you're logged on as the user who has permission to delete the files - you WILL be able to delete them, with nothing more than the standard "are you sure" Windows prompt. – Keithius May 04 '09 at 14:27
1

If you want a full logical protection, since Deny takes precedence on Allow, File Properties > Security tab > Advanced Security Setting , Deny to Everybody the delete right on this file.

Again, a full backup of this file is in order.

Johan Buret
  • 247
  • 4
  • 8