You cannot delete a file when it is in use in Windows. When a process opens a file, it locks the file while it is in use. You will get the error message that you cannot delete the file because it is in use by another process. All operations to the file like delete, rename, open, edit, etc. will be disabled while the file is locked by another process.
Some quick solutions to File in use error
Use Windows Shadowcopy (VSS)
In a hurry to copy the file which is being used by another program? you can do it in one command! Windows Shadowcopy can be used to extract a copy of the file being used by the system itself. Follow the steps below: This is how you can quickly copy the file without a lot of hassle. Replace
Close the program
If you are using the latest version of Windows 10, please note that it gives more details than the generic error we mentioned above. Most of the time, Windows can identify the program that is locking up the file, and will specify this in the error message. For example, in the screenshot below, Windows identifies and specifies that the PDF file is open in Foxit Reader. When I close Foxit Reader, I’ll be able to delete the file without any warnings. But some processes become stubborn and don’t unlock the file even when they are closed and the file won’t delete whatever you do. For this, we will show you how to force delete a file even if it is locked. You can also force delete a folder using similar techniques. Let’s discuss some of the instant solutions if Windows is not showing the process name which is locking the file.
Restart Windows Explorer
If a file is opened by Windows Explorer, it will get locked until Windows File Explorer releases it or we restart the process. To restart the Explorer process in Windows 10, follow the steps below: If you are using Windows 8.1, Windows 7 or earlier, you should follow the steps below: This will start Windows Explorer again. After restarting, try deleting, moving or renaming the file. If you still get access denied, move on to the next solution. If these steps resolve your issue and you get this issue frequently, you should launch file explorer processes in separate windows. This will make sure that you don’t lose your work just because one file is stuck and you have to restart the Windows Explorer process. To launch each file explorer process is a separate window, follow the steps below: This makes sure that only the problematic Windows Explorer process gets closed or restarted.
End process using the Task Manager
If you know that it is not Windows Explorer and another specific process is locking the file, you can simply go to Task Manager, select the process and press the delete button. This will kill the problematic process. If still files access is denied, try the next solution.
Restart the computer
When nothing works, restarting the computer can be beneficial. If you don’t get this problem frequently, try restarting your computer. A clean boot is preferable because it will not cache anything in the memory. If you still can’t delete a file, probably a system process is locking up the file and you will need third-party file unlocker tools discussed below.
Using third-party tools to unlock a file or folder
Microsoft Process Explorer
Microsoft Process Explorer is an advanced task manager. It not only lists the processes running on your computer but also the files or handles they have opened. To find which process is locking a specific file, follow the steps below:
IObit Unlocker
IObit Unlocker is a great tool for unlocking files quickly. Unlocker gives multiple ways to quickly unlock files. You can open the Unlocker window and add multiple files (either by clicking the Add button or drag n drop) to unlock. Another feature of Unlocker is that it adds a menu item in the file and folder context menu. The user can simply right-click the stubborn file and select IObit Unlocker.IObit Unlocker in the context menu The program will automatically list down the processes locking down the file. You can simply click on the Unlock button to free the file.Unlock file using IObit Unlocker If your files get locked frequently, IObit Unlocker is a must-have tool for your system.
LockHunter
LockHunter is another wonderful and free tool to unlock files instantly. It has an intuitive interface where you can select from multiple options like unlock delete, unlock rename, unlock move, etc. It also gives you the option to terminate the locking process instead (sometimes you will need to terminate all related processes before terminating the locking process). LockHunter also adds a context menu item by the name “What is locking this file?”. You can right-click the file and simply select “What is locking this file?” and LockHunter will come up with multiple options.LockHunter You can also use LockHunter from the command prompt. Just follow the command-line instructions from here. 99% of the problems are solved using the methods given above. If you still have issues deleting your files, please let us know in the comments section below and we’ll do our best to resolve your specific needs. Also see:
How To Show Hidden And Protected Files And Folders In Windows 11/10How to Delete Locked Files/Folders in Windows 11/104 Ways To Open Command Prompt Window in a Folder In Windows 106 Ways To Run Programs As Administrator In Windows 11/104 Ways To Fix Right-click Not Working on Taskbar And Start Menu In Windows 10