How can I prevent a folder from being inadvertently deleted by myself?

I have a very important folder on my Desktop. I occasionally clean up my desktop and I am very concerned that I might delete the mentioned folder inadvertently. Is there a way to prevent such a disaster without limiting my frequent read-write operations on the folder's content? Note I don't mind deleting the content inside the folder one by one on occasion but the folder itself matters to me. If it is deleted, I lose a lot of efforts.


Solution 1:

Don't try to avoid the inevitable. Use backups and version control.

You could deny yourself the Delete permission though. Deleting files and folders within that directory is a separate permission that you could also disable when required.

Solution 2:

There is a better solution to your problem: move the folder to a more appropriate place (e.g. %USERPROFILE%\Documents)

If you must have access to the folder from the Desktop, you can always create a shortcut. This ensures that while you might accidentally delete the shortcut, you never actually delete the folder or its precious contents themselves.

If other applications depend on this folder being on the Desktop, you could create a symbolic link with the "mklink" command. Since symbolic links are handled at the file system level (while shortcuts are actual files that simply point to another location), there should not be any compatibility issues with programs that try to use this type of "shortcut" in paths.

Solution 3:

Yes, potentially limited by which version of Windows you have (Home versions may not have the ability to adjust ownership). Also, beware that removing your delete permissions is not a guarantee that you can't delete the folder. I've been burned multiple times.

Here is a method that is usually foolproof:

  1. Create a new user
  2. Assign ownership of the folder you don't want to be able to delete to this new user
  3. Remove your user's access to delete the folder, make sure your user has full read/write privileges in the folder.

I've used this trick on Windows NT to Windows 7. Sometimes you have to monkey around with the settings a bit before you get it perfect.

TEST THIS ON A NEW FOLDER FIRST (including creating files and folders within the test folder!

Also: Heed the advice of "Use Backups and version control". If the files are that important, you need at least 2 copies.