How to create a folder or file that cannot be deleted in Windows 10
Windows 10 has a Recycle Bin to protect against accidental data deletion. However, users can still delete folders and files that they don't know they have accidentally chosen to delete by emptying that Recycle Bin. Therefore, the Recycle Bin is not a completely proof-of-concept safeguard for accidental data loss.
However, you can make a folder or file undeletable in Windows so that it never ends up in the Recycle Bin. Then Explorer's standard Delete option won't work for your protected folders or files. This is how you can create a folder or file that cannot be deleted in Windows 10.
How to create a folder or file that cannot be deleted by modifying its permissions
This first method allows you to make both a folder and a single file undeletable. It involves denying all permissions to a folder or file so that the user cannot delete it. Here are the steps to make a folder or file undeletable by modifying permissions:
1. First, click the File Explorer shortcut on the taskbar and display the folder that includes the folder or file you want that cannot be deleted.
2. Right click on the folder or file and select Properties .
3. Click Security in the file or folder properties window.
4. Click the Edit button on the Security tab .
5. Select SYSTEM in the Group or user names box .
6. Click the Deny check box for the Full Control setting , which will also check all the other boxes below it.
7. Repeat the previous two steps for all accounts shown in the Group or user names box . After that, permission will be denied for all usernames.
8. Select the Apply option of the permissions window.
9. Click Yes to confirm you want to deny permission.
10. Then click OK in the permissions and properties window.
Now, try to delete the folder or file you just created that cannot be deleted. Right click on the folder or file and select Delete . The Folder Access Denied window with the Continue option will appear. Clicking Continue will bring up another window with a Try Again button . Selecting Try Again will never delete the file or folder.
However, you cannot open or edit any folders or files that cannot be deleted in this way. If you want to open or edit a folder or file that can't be deleted, you'll need to undo all permission changes you've made. Display the permissions window for the file or folder, as outlined in steps 1 to 4 above, and then clear all Deny checkboxes to gain access again.
How to create a folder that cannot be deleted with Command Prompt
You can set up a new undeletable folder with the reserved Windows keyword by executing the CMD command. Since that folder will have a reserved keyword name, you won't be able to delete it in File Explorer. Here's how you can create an undeletable folder with a reserved name in the Command Prompt app:
1. To access the search box, press the Windows logo key together with S .
2. Enter the Command Prompt search term in the file finder utility.
3. Open Command Prompt with admin rights by selecting the Run as administrator option in the search results.
4. Open the folder where you want to create a new folder by entering the Cd command. For example, execute the following command to display the Users folder in the prompt window:
CdUsers
5. Then enter the command to create this directory and press Enter :
md con
6. Execute this command to close the Command Prompt window:
exit
Now, open File Explorer and the Users folder or other folder where you created the new subfolder. Right clicking on that subfolder and selecting Delete will not delete the folder. The "Location is not available" error message will also appear if you try to open the folder.
Of course, a folder that you can't open won't be of much use. However, you can still move files to and from that directory using CMD commands. For example, suppose you want to move the image.png file stored in the C:Users directory to a subdirectory in the same directory. Then you will need to execute this move command:
move "c:Usersimage.png" "c:Userscon"
That command moves the image.png file into a subdirectory. Then you also need to use the same command to move the file out of the subdirectory. The reverse command to move the same file out of that directory back into the Users directory is:
move "c:Usersconimage.png" "c:Users"
Subfolders is one of many reserved keywords you can use for a directory that cannot be deleted. PRN, NUL, COM1, LPT1, AUX and CLOCK$ are other reserved keywords with which you can create undeletable directories.
This subfolder cannot be deleted in File Explorer, but you can still delete it using Command Prompt. To do so, open the include subfolder in Command Prompt. Then execute the following delete command:
rd /s /q con
How to create a folder that cannot be deleted with NH Folder Hider and Locker
If you prefer a more automated method to create an undeletable folder, check out the freeware NH Folder Hider and Locker. NH Folder Hider and Locker is software with which you can lock folders to make them undeletable. You can then unlock the folder with the program whenever you need to access it. You can create a folder that cannot be deleted with that software as follows:
1. Open this NH Folder Hider and Locker page on Softpedia.
2. Download the app, then double-click the downloaded NH Folder Hider and Locker.
3. Select the I agree check box for the software's license terms.
4. Click Next a few times and select Install .
5. Select Finish in the setup wizard of NH Folder Hider and Locker.
6. Double-click the desktop shortcut NH Folder Hider and Locker.
7. Enter new username and password to open NH Folder Hider and Locker.
8. Click the Set button .
9. Select OK on the NH Folder Hider and Locker dialog box message that appears.
10. Then enter the username and password you just set and click the green tick button.
11. Select the Folder Lock tab .
12. Click Browse , select a folder that cannot be deleted and select Lock .
13. Press the Lock button .
14. Then press the OK button of the dialog box.
Go to any folder including the one you just created that cannot be deleted. Right click on your newly locked folder to select Delete . Or select a folder and press the Del key. An access denied message will appear in one of two ways.
If you want to access the folder, you'll need to unlock it. To do so, reopen the NH Folder Hider and Locker software; Click Browse in the window to select the locked folder. Then press the Unlock button to be able to access and delete the folder.
You should read it
- Instructions for creating and using BAT file on Windows
- How to Create a Computer File
- How to create an EXE installation file
- How to quickly create new blank text files on Windows, Mac and Linux
- How to create a new host file on Windows
- Use CMD to create an 'undeleted' folder on Windows
- How to create an ISO file on Linux
- How to Make a New File in Windows
May be interested
- How to Create a Computer Filethis wikihow teaches you how to create a new file, such as a document, on your computer. windows users can create basic files from within file explorer, but all computer users can create a new file from within the 'file' or 'new' menu in...
- How to Create a Bootable Windows XP ISO from a Folderif your computer came installed with windows xp, but didn't come with a disc, you may be wondering how to go about reinstalling in case something happens. luckily, you can create a windows xp installation disc with the files on your hard...
- How to Make a New Folder on a Computerthis wikihow teaches you how to create a new, empty folder on both windows and mac computers. go to the area where you want to create the folder. the easiest example is your computer's desktop, but you can create a folder anywhere on your...
- How to Hide a File or Folder from Search Results in Microsoft Windowsthis wikihow article will teach you the steps to hiding a file or folder (de-indexing it) from your pc's search results in microsoft windows. open file explorer. click the file explorer taskbar icon which resembles a file folder.
- How to Create a Folder on a Macyou can create folders on your mac using the finder and apple's built-in file manager.
- Instructions for finding and recovering deleted datawhat would you do if after deleting a file but realized it was an important file? or is there a file that is suddenly infected by virus and then deleted by antivirus software? undelete 360 is an effective solution that can be used in this case.
- How to Create a Shortcut (Alias) for a File or Folder on Macyou can use a feature called 'alias' to create a quick access shortcut to a specific folder or file whenever on your mac.
- How to safely delete sensitive files on Windows 11when you tell windows to delete a file, you usually want it gone forever. however, some data recovery applications and services can restore those files even if you think they've been completely deleted.
- How to delete Windows.old folder on Windows 10 to free up hard drive spacewhen you upgrade the operating system to windows 10, the old version of windows is not deleted but instead changes into the windows.old folder so you can return to the old version of windows if needed.
- How to recover deleted files on Android phoneshow to recover deleted files on android phones. as you know, when we delete a file on the computer, it can be restored by going to the trash folder to recover the mistakenly deleted file. however, on android, we do not have the function