Sometimes, when you try to delete a file in Windows, you may see a 'File in use' notification, which prevents you from deleting that file. In many cases, you will also not be able to open, move, or rename that file. This is because an application or process is using the file. You may be able to see which program is using that file, or it may be a hidden process running in the background. In any case, if you want to delete that file or modify it in any other way, there are a few methods by which you can do so successfully.
Method 1: Identify the program manually and close it
The simplest method of getting rid of the 'File in use' error is to determine which program is using it and close it. You may have opened the file and forgotten to close it. If you have closed the file, try closing the program with which you opened the file and then check whether you can delete the file.
It can also happen that you have opened multiple instances of the file, and have closed some of them but not all. Take a look at the taskbar and see whether the file is minimized and close all the instances before trying to delete it again. If you don't remember which application you used to open the file, or cannot identify it, close all open programs and then try to delete the file again.
Method 2: End the process or application using Task Manager
You can use the Windows Task Manager built into the OS to check running processes and applications and close them from there.
- Right-click on the taskbar and select 'Task Manager' or use the
Ctrl
+Shift
+Esc
/Ctrl
+Alt
+Del
shortcuts to launch it.
![](https://allthings.how/content/images/2025/02/image-208-1.png)
- The Task Manager should launch with the 'Processes' tab selected by default. If it is not, click on the tab on the left to select it.
![](https://allthings.how/content/images/2025/02/image-209-1.png)
- Look for the program you use to open the file on the right side. For instance, you may have opened a PDF file in Microsoft Edge. So, right-click on Edge and then select 'End task'.
![](https://allthings.how/content/images/2025/02/image-210-1.png)
- You can close all the programs you think might be using the file in this manner.
Method 3: Change the process settings in File Explorer
The Windows File Explorer opens all windows with a single 'explorer.exe' process by default but may sometimes start multiple processes due to certain settings on your system. If the file you want to delete is being used by any of these processes, you won't be able to delete it. So, you will need to change the process settings in File Explorer.
- Open File Explorer, click on the three dots at the top next to 'View', and then click on 'Options'.
![](https://allthings.how/content/images/2025/02/image-212-1.png)
- When the Options dialog box appears, go to the 'View' tab and disable the 'Launch folder windows in a separate process' option by clicking the checkbox next to it so it is not checked.
![](https://allthings.how/content/images/2025/02/image-213-1.png)
- Click on the 'Apply' button and then try deleting the file again.
Method 4: Turn off the Preview pane in File Explorer
If you've enabled the Preview pane in File Explorer to see file previews, it can also result in the 'File in use' error. Disabling it might get rid of the issue.
- Open File Explorer, click on 'View', and check that the 'Preview pane' is not selected. If it is, click on it again to disable it.
![](https://allthings.how/content/images/2025/02/image-214-1.png)
- Now, try deleting the file again and see if it works.
Method 5: Use Command Prompt to force delete the file
Command Prompt lets you force delete a file if you cannot do so using File Explorer.
- Open File Explorer and navigate to where the file you want to delete is located.
- Click on the address bar and copy the path to the file.
![](https://allthings.how/content/images/2025/02/image-217-1.png)
- Open the Start menu, type
cmd
and click on 'Run as administrator'.
![](https://allthings.how/content/images/2025/02/image-218-1.png)
- When the Command Prompt window opens, type
cd
followed by the path you copied and hit Enter.
![](https://allthings.how/content/images/2025/02/image-219-1.png)
- Now, open the Task Manager as explained earlier and right-click on 'Windows Explorer' before selecting 'End task'.
![](https://allthings.how/content/images/2025/02/image-220-1.png)
- Return to the Command Prompt window and type
del "file name"
before hitting Enter to force delete the file. Replace 'file name' with the name of your file.
![](https://allthings.how/content/images/2025/02/image-221-1.png)
- Once the file is deleted, use the
Ctrl
+Shift
+Esc
shortcut to launch the Task Manager. - When the Task Manager opens, click on 'Run new task' and type
explorer.exe
to restart File Explorer.
![](https://allthings.how/content/images/2025/02/image-222-1.png)
Method 6: Identify the program using the file with Resource Monitor
Resource Monitor is a built-in utility in Windows that shows you how different applications and processes are using the available resources. It can also help you find out which program is using the file you want to delete.
- Open the Start menu, type
resource monitor
, and click on 'Resource Monitor' in the search results.
![](https://allthings.how/content/images/2025/02/image-234-1.png)
- When the Resource Monitor opens, go to the 'CPU' tab at the top and click on 'Associated Handles' to expand the section.
![](https://allthings.how/content/images/2025/02/image-235-1.png)
- Enter the name of the file you want to delete in the search box and Resource Monitor will show you all the processes using it currently.
![](https://allthings.how/content/images/2025/02/image-236-1.png)
- You can stop the processes using the file by right-clicking on each process and selecting 'End task'. Then go to the file and try to delete it.
Method 7: Use the Process Explorer to unlock the file
Microsoft's Process Explorer is another tool that can help you free up the file you want to delete from whatever program or process is using it. However, it is not installed by default on Windows, so you will have to get it from Microsoft's website.
- Go to the Process Explorer download page and click on 'Download Process Explorer'. This will download the tool as a zip file containing three .exe files.
![](https://allthings.how/content/images/2025/02/image-224-1.png)
- Once the .zip file is downloaded, extract it and open the .exe file which is compatible with your system.
![](https://allthings.how/content/images/2025/02/image-225-1.png)
- You will need to agree to the terms after which the Process Explorer will launch. Click on 'Find' at the top and then on 'Find Handle or DLL'. Alternatively, you can use the
Ctrl
+Shift
+F
shortcut.
![](https://allthings.how/content/images/2025/02/image-226-1.png)
- Type in the name of the file you want to delete and click on the 'Search' button. The tool will show you the processes that are currently using the file.
![](https://allthings.how/content/images/2025/02/image-227-1.png)
- Once you find the process or application using the program, you can end it using the Task Manager. This should let you delete the file.
Method 8: Unlock the file using Powertoys
Powertoys is a powerful tool that can help you unlock the file you want to delete from whatever program is using it.
- Download Powertoys from the Microsoft Store.
![](https://allthings.how/content/images/2025/02/image-229-1.png)
- Once Powertoys is installed, launch it from the Start menu and click on 'File Locksmith' on the left.
![](https://allthings.how/content/images/2025/02/image-230-1.png)
- Then click on the toggle on the right to enable File Locksmith.
![](https://allthings.how/content/images/2025/02/image-231-1.png)
- Head to the file you want to delete, right-click on it, and select 'Unlock with File Locksmith'.
![](https://allthings.how/content/images/2025/02/image-232-1.png)
- You can directly close the program using the file from here by clicking on 'End task'. Then you can try to delete the file again.
Method 9: Delete the file in Safe Mode
If you cannot delete the file using the above methods and do not wish to rely on third-party tools, booting into Safe Mode might help.
- Press and hold the
Shift
key and restart your computer. - Your PC will boot into the Windows Recovery Environment. Click on 'Troubleshoot' and then on 'Advanced Options'.
- On the Advanced Options page, click on 'Startup Settings' before clicking on the 'Restart' button.
![](https://allthings.how/content/images/2025/02/image-228-1.png)
- Select 'Safe Mode' and let your PC boot up. Then go to the file and try deleting it.
Things to know
- Third-party tools like Unlocker and LockHunter can also help you unlock the file from the program using it so you can easily delete it.
- If you can successfully unlock the file you want to delete but cannot delete it, consider rebooting your PC and then trying again. This will end all unnecessary processes and give your computer a fresh start, which may help fix the problem.
- Handle is the command-line form of Process Explorer and can help you identify which application or process is using a particular file using Windows Powershell. However, using Process Explorer is much easier for most people.
- Make sure force-closing an application or ending a running process is safe before you do so. Ending a process while it is using your file can damage the file and make it unusable. You may want to create a backup of the file just in case something goes wrong when you stop the application using it and delete the file.
Member discussion