Sometimes, it happens that you want to delete a file and Windows prevents you from doing so by telling you that the file is currently in use.
Except that sometimes, even closing all the windows displayed on the screen, the file remains impossible to delete.
The alternative solution that works most of the time is to restart your computer and directly delete the file you want before it gets locked again by no one knows who.
In this tutorial, we will show you 2 programs to unlock and/or force delete a file without needing to restart your computer.
For this tutorial, we have chosen a small video, as this type of file can be easily locked by playing it with a media player like VLC, for example.
As expected, as long as the file is opened by VLC, it cannot be deleted and Windows tells you : The action can't be completed because the file is open in VLC media player.
In this case, Windows tells you which program is locking this file, so you could close the affected program so that you can delete the affected file. It's recommended, but Windows doesn't always help you.
To unlock and remove this file, download LockHunter and install it.
Then, right click on the file you can't delete and click : What's locking this file?
On Windows 11, click on "Show more options -> What's locking this file?".
A User Account Control (UAC) window appears regarding the "LockHunter" program.
Click on Yes.
LockHunter will detect processes currently using the affected file and display them here.
Thanks to LockHunter, we therefore know that in this case, our "test video.mp4" video is used by the "vlc.exe" program.
Click on "Unlock It!" to unlock this file.
Ignore the warning by clicking Yes.
Once the file is unlocked, you will be able to delete the file from the file explorer.
As expected, the file has been deleted.
As you can see, although LockHunter unlocked the file and we deleted this file, it's still open in the affected program (VLC in this case).
Note that this can have strange effects since the "handle" used by VLC is therefore no longer valid.
Note that you can also directly close the process using the affected file rather than unlocking the desired file.
To do this, in the "LockHunter" window, right click "Terminate Selected Process" on the program using the file you wish to delete.
If LockHunter can't unlock or delete the desired file, you can try with the "FileASSASSIN" program created by Malwarebytes.
Once the program is installed, launch it and click on the "..." button.
Choose the file you want to delete and click Open.
By default, FileASSASSIN will attempt to :
Click on : Execute.
Try to delete the file from the file explorer.
Oddly, unlocking recalcitrant files doesn't always work with this program.
However, FileASSASSIN has a very handy feature that allows you to tell Windows to delete the desired file itself when restarting it.
To do this, select the "Use delete on Windows reboot functions" option and click on Execute.
Obviously, the desired file is still present for the moment.
But, if you look in the registry (via the "regedit.exe" program), you will see that FileASSASSIN has modified the "PendingFileRenameOperations" data in this registry key : HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager.
In the value, you will see the path of the file that you asked FileASSASSIN to delete when you restart Windows.
After restarting, you will see that Windows deleted the desired file automatically.
® InformatiWeb.net 2008-2022 - © Lionel Eppe - All rights reserved.
Total or partial reproduction of this site is prohibited and constitutes an infringement punishable by articles L.335-2 and following of the intellectual property Code.