The most common reason for losing data is accidentally deleting files and folders. Most of you must have lost files at least once by accident. The best resolution to this problem is to make the files and folders undeletable in Windows 11/10.
Make Files and Folders undeletable in Windows 11/10
It is common for users to share their systems with other users. System files & folders are critical and cannot usually be deleted. If you want to make your files or folders undeletable, you have two options:
- Through Folder Properties
- Using the Command line
- Using freeware Prevent.
This could be done by changing the permissions to the file or folder or through elevated Command Prompt. Both methods have been explained as follows:
1] Through Folder Properties
Permissions to every folder are usually the same or similar by default, but you can change the permissions individually for every folder. The procedure to do so is as follows:
- Right-click on the file or folder and select Properties.
- In the Security tab, select the active user account (or the user account for which you intend to block the permissions).
- Click on Edit.
- Uncheck the box corresponding to Full control and Modify under the category Allow. You can also check Deny for Full Control.
- Click on OK to save the settings.
2] Using the Command line
Making changes to the Folder properties is the favored method for making a folder undeletable. However, if you need more security and privacy with the folder, you could create a con folder via an elevated Command Prompt.
The limitation of the con folder created through elevated Command Prompt is that it cannot be browsed. You can only move files to and fro using the move command. The procedure is as follows:
- Search for Command Prompt in the Windows search bar. Right-click on Command Prompt and select Run as administrator.
- Type the drive letter of the drive in which you intend to create the con folder, followed by a colon. E.g.. “D:”.
- Now type the following command and hit Enter:
md con\
- It will create the con folder in the intended drive.
Read: How to create CON, AUX, NUL folders and files with a click on Windows.
Deleting the undeletable folder
The undeletable folder cannot be deleted manually but through elevated Command Prompt. The procedure is as follows:
- Open the elevated Command Prompt and navigate to the drive where you created the undeletable folder earlier.
- Enter the following command and hit Enter to execute it:
rd /s /q con\
This method works for folders only and not files.
3] Using Prevent
Some of you may want to check out our freeware Prevent. It is free software that runs on all Windows. If you don’t want anyone deleting, moving, copying, renaming, or messing around with your data, Prevent may help you.
I hope these solutions help.
How do I delete an empty folder that won’t delete?
Usually, it’s because of the lock, which prevents the folders from being deleted even by an admin user. The right way to delete such folders is to boot them into Safe mode and then delete those folders. The safe mode will ensure no external programs have locked the folder.
Why can’t some folders be deleted in Safe Mode?
If you are an administrator and cannot delete a folder, it’s primarily because of an ACL or Access Control List. There must be another admin account on your PC that has blocked deleting these files or folders by taking up the right to control them.