One of the most common problems PC users encounter is that a file cannot be deleted. Sometimes these files interfere with your work or just bring aesthetic inconvenience. Nevertheless, you should know that it is still possible to remove them.
There are different reasons why you can’t delete some files in the traditional way. These files may be used by another app or process, they may be blocked by the administrator, or they may have write protection enabled. In any case, if you do not know how to delete a file that cannot be deleted from your Windows PC or Mac, this article is for you.
How to delete a file on a Windows PC
The most common reason for not being able to delete a file in Windows is that it is occupied by some system process. In this case the message “The action cannot be performed, because this file is used by another program” appears.
In that case, you have to close the program that is using the file and try again. If you see its window, just click on the cross. If the utility is running in the background and you don’t know how to close it, follow these steps:
- Run Task Manager by pressing “Ctrl + Shift + Esc“.
- Find the program in the list and right-click on it.
- Finally, select “End task”.
If you can’t find the program you need in Task Manager, try a third-party utility that unlocks files. The free app LockHunter can help you.
- After installing it, right-click on the file and select “What is locking this file?”
- When the LockHunter window appears, click “Unlock It!”
- After that, try to delete the file again.
If unsuccessful, restart your PC and try again. To completely remove it from the system, remember to empty the Recycle Bin.
How to delete a file if the PC reports that you are denied access
Sometimes a file cannot be deleted because your account doesn’t have permission to do so. In such cases, Windows reports that access is denied. To solve the problem, you need to change the owner of the file. In the process, you may need the username and password of your PC administrator account.
To change permissions, just do the following:
- Right-click the file and go to “Properties”.
- Then select “Security” and click “Advanced”.
- Near your username click “Change”.
- After that, click “Advanced…” and then select “Find Now”.
- Finally, select the current account from the list and click “OK”.
Once you have completed these steps, you will probably be able to delete the file in the usual way. If that doesn’t work, try restarting your computer and trying again.
What to do if nothing helps
In desperate, situations you can try to archive an unrecoverable file and then delete it, and then the archiver will do everything for you. Any archiving app will do the trick. For example, the free 7Zip.
- Launch the archiver, find the desired file and, having highlighted it, click the “Add” button on the toolbar.
- All you have to do is to check the “Delete files after compression” option and click “OK”.
The uninstalled item will be deleted automatically, while the created archive can be sent to the trash by yourself without any problems.
- How to fix blank icons in Windows 11
- How to enable a microphone on Windows 11
- How to fix Windows 10 frozen start menu
How to delete a file in macOS
In most cases, you won’t be able to delete a file on your Mac when it tells you that the file is already in use. Here’s what you can try to do:
- First, manually close the applications that used the file and try erasing it again.
- If you see the program icon in the Dock, right-click on it while holding down Option and select “Forcibly close”.
- If the app doesn’t appear in the Dock, type “System Monitoring” in the Spotlight search, open it, and then look for the program in the list or through the built-in search and click the cross on the toolbar to finish.
If that doesn’t work, enter safe mode. To do this, turn off your Mac completely and then turn it on without releasing the Shift key (Intel processors). On Apple chip devices, hold down the power button, select the bootable volume, and hold down the Shift key to continue in recovery mode. Try moving the file to the recycle garbage can and clearing it. Then reboot your Mac to return to normal mode.
What to do if a file cannot be deleted for other reasons
Another solution is to delete through the console, bypassing the Recycle Bin and all system confirmations.
- To do this, run “Terminal” via Spotlight or from the “Programs” and “Utilities” folder.
- Then copy and paste the command “sudo rm -r”.
- Press Space and then drag and drop the file into the window.
- After that, press Enter and enter the administrator password.
Moreover, the file may not be deleted due to disk errors.
- Therefore, open the Finder and run “Disk Utility” from the “Programs”, and then the “Utilities” folder.
- Finally, use it to check the disk where the item of interest is located with the “First Aid” service.
After checking, restart your Mac and try to delete the file.