Tuesday 6 September 2011

How to Protect Files From Deletion in Windows


delete

A novel way to protect important files on your hard disk is to prevent them from getting deleted accidentally. This can be done in an NTFS partition by setting appropriate access permission to that file or folder. This article will show you how to do that.

Method 1: Protect all files within a folder

The NTFS file permission dictates that users who are granted Full Control on a folder can delete any files in that folder regardless of the permissions that protect the file. Hence to protect files in a folder from deletion, it is essential to deny Full Control on that folder. Once that permission is revoked, all files within that folder are automatically protected from deletion without having to set permission for each file individually. The steps required to do this is described below.
1. Create a folder on the root of an NTFS formatted hard drive partition. If the folder which you want to protect already exist and is nested several folders deep, it is recommended to move this folder to the root of the partition.
2. Right-click on the folder and choose Properties.
3. Click on the Security tab and then click Advanced.
4. Click Change Permission, and on the next window highlight Administrator and click Edit
advanced-security-settings
5. Under Permission settings, check the boxes “Delete subfolders and files” and “Delete” under the Deny column.
permission-folder
6. Click OK on all opened windows until you have closed them all.
The folder is now protected. Under this folder you can create new files or edit existing files but you cannot delete them or rename them. Attempting to do so results in this File Access Denied message.
deny-delete

Method 2: Protect only selected files

This is somewhat difficult to achieve for reasons already explained – users who have full access to the parent folder can delete files regardless of the permissions that protect the file. So even if you deny Delete access to a file, if the parent folder is set to Full Access the user will be able to delete the file all the same. But there is one way by which we can workaround this problem.
1. Right-click on the file you want to protect and choose Properties.
2. Check the attribute “Read-only” and click Apply.
properties-read-only
3. Open the Security tab and click Edit.
4. Highlight the user name Administrator and check the box “Write” under the column Deny.
permission-delete-deny
5. Click OK on all windows to exit.
The file now cannot be deleted, but it cannot be edited or modified too. That’s an undesirable consequence of selectively protecting files.

Alternative Method: Use third party software

If working with file permission is too much for you, you can try System Protect – a freeware that prevents deletion of important system files as well as user-selected files. The program runs in the background just like an anti-virus program do and continuously monitors all access to the protected files. If any process tries to delete the files the user is alerted. The program can be configured to automatically deny all delete attempts or ask the user for action. Additionally, System Protect allows files and folders to be password protected.
system-protect

No comments:

Post a Comment