
Can't delete a file because 'it's in use'
Getting the dreaded 'file is in use' error when trying to delete? Here's how to close the program that's holding onto it.
What's Happening
You're trying to delete a file, but Windows says it's in use by another program. This happens when a program or background process has the file open—even if you don't see it running. Windows won't let you delete files that are actively being used because it could crash the program or corrupt data.
Common culprits include: media players holding onto video files, Word or Excel keeping documents open in the background, antivirus programs scanning files, cloud sync services like OneDrive or Dropbox, or Windows Explorer itself displaying thumbnails.
Quick Checks
Before diving into fixes, try these quick steps:
- Close any programs that might be using the file (especially the program that created it)
- Check your system tray for background apps that might have the file open
- Wait 30 seconds and try again—sometimes background processes need a moment to release files
- Restart your computer if you're in a hurry—this will close all programs and release all files
Step-by-Step Fixes
Fix 1: Close File Explorer and Reopen It
Sometimes File Explorer itself is the problem, especially if you were previewing the file.
- Right-click the taskbar and select Task Manager
- Find Windows Explorer in the list
- Click it, then click Restart at the bottom (your screen will flash briefly)
- Open File Explorer again and try deleting the file
Fix 2: Find Which Program Is Using the File
Resource Monitor can show you exactly which program has your file locked.
- Press Windows Key + R, type
resmon, and press Enter - Go to the CPU tab
- Click the little arrow next to Associated Handles to expand it
- In the search box, type part of your file name
- Look at the Image column to see which program is using it
- Close that program, or right-click it and select End Process
- Try deleting the file again
Fix 3: Use Task Manager to Close the Program
If you know which program is using the file but it won't close normally:
- Right-click the taskbar and select Task Manager
- Find the program in the list (click More details if you only see a simple list)
- Right-click the program and select End task
- If it doesn't close, click it and select End task at the bottom
- Wait 10 seconds, then try deleting the file
Fix 4: Delete on Restart Using Command Prompt
For stubborn files, you can schedule deletion for the next restart when no programs are running.
- Press Windows Key + X and select Terminal (Admin) or Command Prompt (Admin)
- Click Yes if User Account Control asks for permission
- Type this command (replace the path with your actual file path):
del /F "C:\Users\YourName\Documents\locked-file.pdf" - Press Enter and try again
- If that doesn't work, type:
sfc /scannow
This checks for system file issues that might be preventing deletion
Alternatively, you can use a free tool like Unlocker or LockHunter to identify and unlock files, but the built-in methods above work for most situations.
If Nothing Worked
If the file still won't delete:
- Boot into Safe Mode: Restart your PC and press F8 during boot (or use Settings → Recovery → Advanced startup). In Safe Mode, only essential programs run, so your file should be unlocked.
- Check file permissions: Right-click the file, select Properties → Security tab, and make sure your user account has Full Control.
- Scan for malware: Sometimes malware locks files. Run Windows Security or your antivirus to scan the file.
- Check cloud sync status: If the file is in OneDrive, Dropbox, or Google Drive, pause syncing temporarily and try again.
When to Call a Pro
If the file is a system file or located in Windows, Program Files, or other protected folders, deleting it could break your computer. If you're seeing 'Access Denied' even in Safe Mode, or if the file reappears after you delete it, you might have a malware infection that needs professional removal.
Also, if you're deleting files because a program won't uninstall properly, that's a separate issue that might need a tech to fix correctly.
Need Professional Help?
If you're in the Tampa Bay area and need hands-on assistance, Geeks in Sneaks provides friendly, on-site tech support in Clearwater, Clearwater Beach, and Dunedin.
Related Topics
Need Professional Help?
If you're still having trouble, our expert technicians can help.
Learn about our pc repair service