How to prevent file deletion in Vista

Rather than finding out how to undelete files, it is of course better to prevent important file from being deleted in the first place. By default file in Vista can be deleted by the owner of the file, which makes a lot of sense in itself. But when you, or someone else using the same computer, accidentally deletes an important file, you might wish deleting a file had not been possible in the first place.

When you look at the file properties of a file in Vista, you can see the the file attributes under the General tab, which has a Read-only option.

File properties in Vista

This checkbox allows the user to indicate that the file is not to be modified. So when you open the file, make changes to it and try to save it, that will not be possible.

But this read-only option will not prevent the file from being deleted! If you mark the checkbox, and then try to delete the file, you can.

To really prevent the file from being deleted, you need to access the Security tab in the file properties window. If the tab is not visible, press Alt to access the menu, then select the Tools menu and click Folder Options. Now select the View tab, and deselect the checkbox named Use Sharing Wizard (recommended) or named Use simple file sharing (Recommended). Click OK to confirm the changes.

Within the Security tab, you will see the groups and user names for which security information is available. The lower half of the window shows the actually permissions for the selected user or group.

Security access details for a file

To change the permissions for a group or user, select the Edit button. This will bring up the security window, where you can select the group or user for which you want to change the file permissions.

User access permissions for a file

If the user is not shown, you can use the Add button to select a network or computer users.

Now select the user or group for which you want to change the permissions so they cannot delete your file. Then make sure that they only have the Read &execute, Read, and Write options enabled. The Full control and Modify checkboxes should not be selected as they control the option to delete a file.

Click OK to confirm the change of permissions.

That’s it, the users or groups you have changed can see your file, and open them, but they can no longer delete the file!

Keep in mind that a user with administrative priviliges can always change the permissions again and still delete the file. So even though this is a good way to help prevent accidental deleting of files, it is always best to make a backup of your important files.

How to restore a file from the recycle bin in Vista

In the default Vista configuration, Vista makes use of the recycle bin to delete files. So before a file is physically removed from a disk, it is first moved to the recycle bin. That allows the user to restore the file if required.

To restore a file from the recycle bin in Vista, simply double-click the Recycle Bin icon on the Desktop, or right-click the recycle bin icon and in the popup menu select Open.

This will bring up an explorer window that shows the contents of the recycle bin.

To restore a file, right-click the file, and in the popup menu select Restore.
Restrore file from recycle bin

The file will be restored to the original location from where it was initially deleted.

How to change the size for the recycle bin in Vista

When files ore folders are deleted in Windows Vista, they are not really deleted, but they are first stored in the recyvle bin. That’s great if you need to retrieve them after inadvertedly deleting the files. But this also means that the disk space used by these files are folders is not free up until they are physically deleted from disk.
To control the disk space used by the recycle bin, or trashcan, you can change the maximum size that Vista can use for the recycle bin.
Here are the steps to change the maximum size for the recycle bin in Vista:

  1. First locate the recycle bin on the Desktop, and right-click it.
    Note: if the recycle bin is not visisble on the Desktop, change the personalization settings.
    Recycle bin popup menu
  2. In the popup menu that comes up, select the Properties option.
  3. Next, select the disk for which you want to change the maximum space (in case you have multipe disks in your system).
    Properies for recycle bin in Vista
  4. Make sure the Custom size option is selected, and change the value for Maximum size (MB).
    Note: the size is specified in Mega Bytes, so in the example, the maximum size is 5 GB.
  5. Click OK to confirm the change in storage space available for the recycle bin.

The option “Do not move files to the Recycle Bin. Remove files immediately when deleted.” Will effectively set the disk space allocation for the recycle bin to zero. This will save disk spave, but keep in mind that you can not restore files from the recyvle bin anymore with that option active. If you want to delete files without keeping them in the recycle bin, just use Shift+Delete instead of Delete when removing files. This will work even if the maximum size for the recycle bin is not set to zero.

To actually remove the files from the recycle bin, you use the Empty Recycle Bin option in the popup menu as shown earlier. This will present you with a confirmation dialog before the files are actually removed from disk:

Confirm empty of trashcan

If you do not wish for this confirmation to be shown everytime you emty the recycle bin, clear the checkbox in the recycle bin properties called Display delete confirmation dialog.