Cannot delete file or folder in Windows 10
Almost every version of Windows has a problem where system permission issues restrict users from deleting the file or folder. Such files or folders remain in system memory and can't be deleted unless the hard-disk is formatted. This behavior also exists in Windows 10. In this article we are going to take a look at the options that helps us delete such files or folders in Windows 10.
Sometimes when you are using Windows Explorer, you may find it hard to delete a certain file or folder. Moving that file or folder to trash doesn't work either. In such case you may notice that it can't be deleted even with Administrator privileges. You get error messages that you can't take any action on that file or folder.
If such files or folders become part of system memory then deleting them using normal method doesn't work. In this article we are going to take a look at some other methods that you can use to delete such files or folders in Windows 10.
Delete File using Powershell
Sometimes deleting a file or folder from the Windows explorer doesn't work. In such case you have to use Powershell instead of UI. Follow the steps below.
1. Open Powershell by searching from Windows menu.
2. Navigate to the directory which needs to be deleted.
3. Get inside the directory if command prompt allows you to do so.
4. Delete the files or folder using the command : RMDIR /S /Q foldername
5. Exit from current session of Powershell.
6. Open powershell in Administrator control and use del command to delete the parent folder.
Powershell can be used to delete the folder. However do note that deletion of files and folders may not take place if there are some ownership issues. In such case you have to first get the ownership for the file or folder. You can also use command prompt to perform the above steps.
Another Powershell tip is to get control of the ownership and delete the folder from the command line itself.
1. Open Powershell as an administrator.
2. Type 'cacls l:\foldername /T /e /g Administrators:f'
3. After it returns the prompt you have got administrator access.
4. Use this command to remove the directory: rmdir /S l:\foldername or rd /s /q "Path of Folder.
This should work on your computer regardless of the Windows version under installation. If you are not experienced with Powershell or command prompt then I suggest you to use other method instead.
Delete with File or Folder Ownership
Follow the steps to delete the folder using ownership of the folder.
1. Right click on folder that you wish to delete.
2. Choose properties.
3. Click on security tab.
4. Click on Advanced button under security tab.
5. In the new dialog box find the owner of the folder and click on link that says "Change".
6. Add your own account on the new dialog box that appears by clicking on "Edit" button.
7. Click on OK to let the user or the user group take into effect for ownership.
8. Now come back to the "Advanced security settings" tab.
9. Click the checkbox that says "Replace owner of sub-directories and objects".
10. Click apply to let the settings for that folder take effect for current session.
11. Now Windows will prompt you to UAC control being changed.
After this you have control over the folder and you can delete it immediately. If this method does not work then you have to use other means of deleting the folder or sub-directory under it.
If you have such folders not deleted by any other method explained above then chances are that Unlocker can solve this for you. Unlocker gives you option to move, rename and delete the file and folder. You can also schedule the file deletion for next reboot. This way you can delete those directories or files which claim to be in use by other application.
Follow the steps below to delete any folder or file using Unlocker.
1. Install Unlocker
2. Find the folder or file that you can't delete.
3. Right click on the folder and open right click context menu.
4. Select Unlocker from the menu.
5. Choose "Delete" from the dialog box option given.
6. Click OK.
By following the steps mentioned above you can delete the folder which is not easy to delete by any other methods explained above.
If you don't find Unlocker usable for deleting your file or folder then perhaps you should check out "Delete Doctor". This app is similar to the Unlocker. However there are chances that even this app may not work in some circumstances. I personally think that this app should do the trick in most of the cases.
Some other software that you can use :
1. File Assassin: This small app is capable of deleting the file while being used by the process. It can remove modules, files and folders. It can also take over the ownership and remove the files.
2. LockHunter: This app may not be much controlling over the file permissions but surely it does remove the file and folder.
3. IObit unlocker: App offers a lot of features and controls for file deletion, rename and moving to another location. It can also work by changing ownership of the file in question.
Note: Do note that if you didn't manage to delete by any method explained above then your only option is to use repair mode using DVD. In the repair mode you can choose command prompt and then navigate to the folder and then delete it. However do note that it may or may not work. So there is no fixed solution for this problem even in Windows 10.