How to delete undeletable files
Cannot delete file because it is in use by another process; impossible to proceed with the cancellation; file deletion failed; try again and you will be luckier. OK, the last message I made up but the substance of the facts does not change: you can not delete a lot of useless files on the hard disk.
Is the computer plotting against you? Clearly not. What you have encountered is a rather frequent problem, which occurs when a program or a system process keeps a file “busy” preventing its removal. Usually everything is solved by restarting the PC and issuing the command again to delete the file, but why do so much effort when there are some very convenient free applications that allow you to delete undeletable files?
Yes, you read that right! There are programs and system utilities that, in just a few clicks, allow you to free and delete files held in “hostage” by software that prevent them from being deleted. Don’t know how to use them? No problem, take five minutes of free time and consult the tutorial I’m about to offer you. You will be surprised how easy it is!
Index
- How to delete undeletable files on Windows
- Command Prompt
- LockHunter
- Wise Force Deleter
- How do I delete undeletable files from Mac
- Finder
- Safe mode
- Terminal
How to delete undeletable files on Windows
Let’s start this guide by analyzing together what are the best ways to delete undeletable files on Windows. I will tell you, specifically, about the utilities and software that allow you to delete files that the operating system reports as “blocked by other programs”.
I will not deliberately discuss any software that also allows you to delete system files: if you are trying to delete a suspicious file, which is reported to you as “blocked by Windows”, you have most likely contracted a virus or, in general, a malware. If you find yourself in this situation, then, you would do well to read my guide on how to eliminate viruses from your Windows computer, which contains a series of useful tips and tricks to deal with such situations with serenity. Having clarified that, let’s get started!
Command Prompt
The first strategy I recommend you to put into practice is to force the deletion of the locked file using the Windows Command Prompt, available in all editions of the Microsoft operating system. In most cases, this solution proves to be decisive, but I warn you: if the program that blocks the file is not closed immediately after its elimination, it could behave strange, or at least unexpected. Nothing that a restart of the computer cannot solve, rest assured!
Anyway, to get started, go to the folder where the locked file is located and don’t close the window: we will need it soon. Now, open the Windows Start menu (the flag icon located in the lower left corner of the taskbar), type the words Command Prompt in the search field and click on the first result returned. Alternatively, you can find the utility icon in the Windows System or All Programs> Accessories folder of the Start / Start Screen menu.
Now, type the command del /fin the screen that opens, leave an empty space and, without pressing the Enter key , drag the icon of the file to be deleted in the Prompt window, in order to automatically enter the precise path of the file. Once this is done, press the Enter key on your keyboard and that’s it: Windows should be able to delete the file, without any problem.
LockHunter
If the previous solution has not been decisive for you, you can consider using a third-party program, such as LockHunter: it is a free and extremely light program, which integrates into the Windows File Explorer and allows you to delete a locked element simply by right clicking on its icon.
You ask me how to get it? It’s that easy. First, open the software home page, click the Download now button! and wait a few seconds for the program download to complete. Next, open the previously downloaded file (e.g. lockhuntersetup_X.YZexe ) and click on the Yes, Next and Finish buttons to complete the installation.
To unlock a file using Lockhunter, first go to the folder that contains the item in question, right-click on its icon and select What’s locking this file? from the context menu that appears. Now, press the Yes button and wait for the program to analyze the status of the file: after a few seconds, you should see the name of the software that prevents the deletion of the item.
The game is practically done: to unlock and delete the file, press the Unlock It! and then on the Yes and Delete It! . In most cases, this should be enough to permanently get rid of the unwelcome “guest”; if the deletion is not successful, you can still make sure that the file is deleted at the next Windows restart: to order this operation, first click on the Other … button located at the top and then on the Delete At Next System Restart item, visible in the menu that appears.
Wise Force Deleter
Another software that allows you to effectively delete locked files on Windows is Wise Force Deleter: it is a small free utility, compatible with practically all editions of Windows, which allows you to delete files blocked by other programs with extreme ease.
To obtain Wise Force Deleter, linked to this website, click on the Free Download button and wait for the software installation package (eg WFDSetup_1.5.3.54.exe ) to be downloaded to your computer. When the download is complete, open the .exe file obtained, click on the Yes button and put the check mark next to the item I accept the terms of the license agreement, located in the window that appears on the screen.
To conclude the setup, press the Next (two consecutive times), Install and Finish buttons in sequence . When installation is complete, click on the Yes button, in order to automatically start the program; if this does not happen, you can use the icon that, in the meantime, has been added to the Start menu.
Deleting a file with Wise Cleaner is very simple: all you have to do is drag the icon of the locked element into the program window (you can also drag multiple files if you wish), select it and press the Unlock and delete buttons (below right) and Yes.
In some cases, the icon of the deleted file will continue to be visible, for technical reasons related to the management of open files by Windows: to solve the problem, simply close the program that blocked the file – if possible – or restart the computer. That’s all!
How do I delete undeletable files from Mac
The chances of a file being blocked by an application on Mac are much less rare than what happens on Windows, but this is not an impossible event anyway: below I’ll explain how to get rid of blocked elements in a few seconds, using the functions of the macOS operating system.
Finder
If the file is undeletable for a matter of permissions, you can safely use the Finder to edit them, as long as you are logged in with an Administrator account.
Once this condition is met, deleting the blocked item is practically child’s play: first, right-click on its icon, select the item Get information from the context menu that appears and then click on the > symbol next to the item Sharing and permissions, which is located at the bottom of the small panel that has opened.
Now, click on the locked padlock symbol located at the bottom right, type the Mac password in the appropriate field and press the OK button to unlock the changes. Now, take a look at the table located at the bottom of the panel and pay attention to the item Privilege corresponding to your name (marked with the words “Me”): click on the current authorization (eg. Read-only or No access ) and set the menu that appears on Read and Write, to self-give you the necessary permissions to delete the file.
If your username does not appear at all, press on the [+] symbol located at the bottom left, click on the name of your resident account in the next screen and then on the Select button, to add yourself to the list of users authorized to operate on the file. Finally, activate the Read and Write permissions for yourself, as seen above.
The game is practically done: once the permissions of the file have been altered, you just have to delete it in the classic way, by right clicking on its name and selecting the item Move to the trash from the menu that appears.
Safe mode
If, on the other hand, your problem is related to items locked by a program, you can restart your Mac in Safe Mode and try to delete the file from there. For your information, Safe Mode is a particular startup state of macOS in which only essential drivers are initialized, leaving all unnecessary programs closed (even if the option to reopen windows at next login is checked).
To start macOS in safe mode, you can follow two different paths, depending on the type of computer you have: if you have an Intel processor on your Mac, after turning it off, wait 10 seconds, turn it on and immediately press the Shift key on your keyboard, holding it down until the login window appears.
If, on the other hand, yours is a computer equipped with an Apple Silicon processor (eg M1 ), after turning it off, wait 10 seconds and turn it back on by pressing and holding the power button, until the boot options window appears; when this happens, select a startup disk (eg Macintosh HD), hold down the Shift key on your keyboard, click on the Continue in Safe Mode option and release the key.
To verify the successful start-up in safe mode, after logging in to your account, click on the Apple menu (the symbol of the bitten apple located at the top left), select the item About this Mac and press the Report button system…, located in the new window that opens. Now, click on the Software item and verify that, under the Boot Mode item, the wording Safe appears. At this point, you just have to delete with the classic procedure provided by macOS and restart the Mac normally, to deactivate safe mode and return to normal.
Terminal
The last solution I want to tell you is the forced deletion of files through the Terminal, after logging in to the Mac through an account with administrative privileges. Be careful, however: in this way, you can not only delete files locked by other programs, but also those of the system and potentially indispensable for macOS.
Therefore, use this solution only if you have no other viable ways and if you know exactly the nature of the file you are about to delete: an error could lead you to be unable to use one or more programs or even the entire operating system, forcing you to reinitialize the Mac. Then don’t say I didn’t warn you!
In any case, to proceed, click on the Go> Utilities menu located in the Mac menu bar and open the Terminal using the icon that appears in the newly opened folder. Once this is done, type the command sudo rm -rf, leave a blank space and, without pressing the Enter key, drag the file to be deleted into the Terminal window, in order to automatically add the path.
Once this is done, press the Enter key on the keyboard, type the password of your user account on macOS and press the Enter key, to confirm the deletion of the file.