You’re trying to delete a file, rename a folder, or unmount a drive, and Windows hits you with “the requested resource is in use.” It’s frustrating. The error means something is currently accessing that file or folder, blocking your action.
This happens because Windows protects files that programs are actively using. If you could delete or modify them mid-use, programs would crash and data would corrupt. The system is doing its job, but you still need to complete your task.
This guide shows you exactly how to fix this error. You’ll learn what causes it, how to find what’s using your file, and multiple ways to resolve it permanently.
What Does “The Requested Resource Is in Use” Actually Mean?
This error appears when you try to modify, delete, move, or eject something that Windows or another program is currently accessing.
Common scenarios include:
Files and folders: A document is open in an application you forgot about. A background process is reading from that folder.
USB drives and external storage: File Explorer has the drive open. A file transfer hasn’t fully completed. Your antivirus is scanning the drive.
Network resources: A mapped network drive is in use by another program. A shared folder is being accessed remotely.
System files: Windows itself needs that file for basic operations.
The error protects against data corruption. If you deleted a file while Word was saving to it, you’d lose your work. If you ejected a USB drive mid-transfer, files would break.
Why This Error Keeps Happening
Several factors trigger this error repeatedly:
Background processes you can’t see. Windows Search indexes your files constantly. Cloud sync services like OneDrive, Dropbox, or Google Drive access folders in the background. Antivirus programs scan files without telling you.
Programs that don’t close properly. You close a program window, but the process keeps running. Media players, PDF readers, and image viewers often do this.
File Explorer quirks. Even just previewing a file in Explorer can lock it. The thumbnail generator holds files open. Preview pane features keep files in memory.
Multiple user sessions. If someone else is logged into the same computer or accessing files over a network, their session locks those resources.
Stuck handles. Sometimes Windows doesn’t release a file properly after a program crashes. The handle remains open indefinitely.

How to Find What’s Using Your File
Before you can fix the problem, you need to identify what’s holding the file. Here are the most effective methods.
Method 1: Use Resource Monitor
Resource Monitor shows exactly which processes have files open.
Press Windows Key + R, type resmon, and press Enter.
Click the CPU tab, then expand “Associated Handles” at the bottom.
Type your filename or part of the path in the search box.
You’ll see every process currently accessing that file. The list shows the process name, its ID, and the exact handle type.
Right-click any process and select “End Process” to release the file. Be careful with system processes, ending the wrong one can cause instability.
Method 2: Use Task Manager
Task Manager provides a simpler but less detailed view.
Press Ctrl + Shift + Esc to open Task Manager.
Click “More details” if you see the simple view.
Go to the Details tab.
Look for processes that might be using your file. Common culprits include explorer.exe, backup utilities, and cloud storage apps.
Right-click a suspicious process and choose “End task.”
Restart File Explorer specifically by finding “Windows Explorer” on the Processes tab, right-clicking it, and selecting “Restart.”
Method 3: Use Command Line Tools
For advanced users, handle.exe from Sysinternals shows file locks precisely.
Download Handle from the Microsoft Sysinternals suite.
Extract it to a folder like C:\Tools.
Open Command Prompt as Administrator.
Navigate to that folder: cd C:\Tools
Run: handle.exe "C:\path\to\your\file.txt"
The output shows every process with a handle on that file, including the process ID and handle type.
To close a specific handle, use: handle.exe -c <handle_id> -p <process_id>
This is powerful but risky. Closing the wrong handle can crash programs or corrupt data.
Step-by-Step Solutions to Fix the Error
Solution 1: Close All Obvious Programs
Start with the simplest fix.
Think about what programs might use that file. Did you recently open it in Word, Excel, Adobe Reader, or a media player?
Close all open programs completely. Don’t just minimize them.
Check your system tray (bottom-right corner near the clock). Right-click icons and choose “Exit” or “Quit” for programs running in the background.
Try your action again.
Solution 2: Restart File Explorer
File Explorer often holds files open through preview panes and thumbnails.
Open Task Manager (Ctrl + Shift + Esc).
Find “Windows Explorer” under the Processes tab.
Right-click it and select “Restart.”
Your desktop will flicker briefly as Explorer restarts. This closes all Explorer windows and releases locked files.
Try accessing your file again.
Solution 3: Use Safe Mode
Safe Mode loads Windows with minimal drivers and services, preventing most background processes from running.
Press Windows Key + I to open Settings.
Go to System > Recovery.
Under Advanced startup, click “Restart now.”
When the blue screen appears, choose Troubleshoot > Advanced options > Startup Settings > Restart.
Press 4 or F4 to start in Safe Mode.
In Safe Mode, background services like antivirus, cloud sync, and search indexing won’t run. You should be able to delete, move, or modify your file.
Restart normally when finished.
Solution 4: End the Locking Process
Once you’ve identified what’s using the file with Resource Monitor or Handle:
Open Task Manager.
Go to the Details tab.
Find the process by name or PID.
Right-click and select “End task.”
Confirm if prompted.
For stubborn processes, use Command Prompt as Administrator:
taskkill /F /PID <process_id>
The /F flag forces termination. This works when Task Manager fails, but use it carefully.
Solution 5: Disable Search Indexing Temporarily
Windows Search constantly indexes files, often causing this error.
Press Windows Key + R, type services.msc, and press Enter.
Scroll to “Windows Search.”
Right-click and select “Stop.”
Try your file operation.
Restart the service when done by right-clicking and selecting “Start.”
For a permanent fix, you can exclude specific folders from indexing:
Open Settings > Privacy & security > Searching Windows.
Under “Find My Files,” click “Customize search locations.”
Remove folders you don’t want indexed.
Solution 6: Pause Cloud Sync Services
OneDrive, Dropbox, Google Drive, and similar services lock files during synchronization.
Find the cloud service icon in your system tray.
Right-click it.
Look for “Pause syncing” or similar option.
Wait a few seconds, then try your operation.
Resume syncing afterward.
For OneDrive specifically, you can stop it completely:
Right-click the OneDrive cloud icon.
Select Settings.
Go to the Account tab.
Click “Unlink this PC.”
Complete your file operation, then sign back in.
Solution 7: Boot into Another User Account
If someone else is accessing the file through a network share or another user session:
Press Ctrl + Alt + Del.
Click “Switch user.”
Log into a different account (or create one temporarily).
The other session’s locks remain active, but you might have different permissions.
Alternatively, sign out all users:
Open Task Manager.
Go to the Users tab.
Right-click other users and select “Sign off.”
Solution 8: Use Command Prompt to Delete
When normal deletion fails, Command Prompt sometimes succeeds.
Open Command Prompt as Administrator.
Use the del command: del /F "C:\path\to\file.txt"
The /F flag forces deletion of read-only files.
For folders, use: rmdir /S "C:\path\to\folder"
The /S removes the directory and all contents.
If the path has spaces, keep the quotes.
Solution 9: Delete on Next Restart
Windows can queue files for deletion on the next boot, before most processes start.
Download MoveFile from the Sysinternals suite.
Open Command Prompt as Administrator.
Run: movefile.exe "C:\path\to\file.txt" ""
The empty second argument schedules deletion.
Restart your computer.
The file deletes during boot before any programs can lock it.
Solution 10: Use Unlocker or Similar Tools
Third-party tools can force-unlock files, though Windows 10 and 11’s built-in methods usually work better.
Popular options include IObit Unlocker and LockHunter (both free). These tools integrate into the right-click menu, letting you unlock and delete files directly.
Use caution with these tools. Force-unlocking can cause data loss if a program is actively writing to the file.
Fixing USB Drive “Resource in Use” Errors
USB drives trigger this error frequently, especially during ejection.
Close All Files and Folders
Make sure nothing from the USB drive is open. Close all File Explorer windows showing that drive.
Close programs that recently accessed files on the drive (Word, Excel, media players, etc.).
Check for Background Transfers
File transfers continue in the background even if you close the copy dialog.
Open Task Manager.
Go to Performance tab.
Click on your USB drive under “Disk.”
Watch the activity graph. If it shows ongoing reads or writes, wait for them to finish.
Disable Write Caching
Write caching can prevent safe removal.
Open Device Manager (Windows Key + X > Device Manager).
Expand “Disk drives.”
Find your USB drive, right-click, and select Properties.
Go to the Policies tab.
Select “Quick removal” instead of “Better performance.”
Click OK.
Now you can remove the drive without ejection in most cases.
Force Eject Using Disk Management
Open Disk Management (Windows Key + X > Disk Management).
Find your USB drive in the list.
Right-click and select “Offline.”
Windows releases all locks on that drive.
You can now safely remove it.
Set it back to “Online” when you reconnect.
Use Safe Hardware Removal Tool
The Windows safe removal tool doesn’t always work, but it’s worth trying.
Click the “Safely Remove Hardware” icon in the system tray.
Select your device.
If you get the “in use” error, click “Close” and try the other methods above.
Fixing Network Resource Errors
Network drives and shared folders have unique challenges.
Disconnect and Reconnect
Open File Explorer.
Click “This PC.”
Right-click the mapped network drive.
Select “Disconnect.”
Wait 10 seconds.
Reconnect by mapping the drive again: Computer > Map network drive.
Clear Network Credentials
Sometimes cached credentials cause locks.
Open Control Panel.
Go to User Accounts > Credential Manager.
Click “Windows Credentials.”
Find credentials for the network resource.
Click “Remove.”
Reconnect and enter credentials fresh.
Check Network Activity
On the computer hosting the shared folder:
Open Computer Management (Windows Key + X > Computer Management).
Go to System Tools > Shared Folders > Open Files.
You’ll see who has which files open.
Right-click and select “Close Open File.”
The remote user’s access ends immediately.
Preventing This Error in the Future
Prevention beats troubleshooting.
Close programs properly. Always use File > Exit instead of clicking the X. Programs sometimes stay running in the system tray when you close the window.
Disable preview panes. In File Explorer, go to View > Show > uncheck “Preview pane.” Previews lock files unnecessarily.
Pause cloud sync before major file operations. If you’re moving or deleting many files, pause OneDrive or similar services first.
Use “Quick removal” for USB drives. This policy setting (in Device Manager under drive Properties > Policies) prevents write caching, making safe removal more reliable.
Keep Windows updated. Microsoft regularly fixes file handling bugs. Windows Update often resolves persistent locking issues.
Restart regularly. If you never restart, background processes accumulate. A weekly restart clears most file locks.
Monitor startup programs. Press Ctrl + Shift + Esc > Startup tab. Disable programs you don’t need running at boot. Fewer background programs mean fewer file locks.
When to Worry About This Error
Most instances are harmless annoyances. But sometimes this error indicates bigger problems.
Malware. If unknown processes constantly lock files, run a full antivirus scan. Malware often protects its files from deletion.
Failing hard drive. Repeated errors with random files might signal hardware failure. Run chkdsk /f from an Administrator Command Prompt to check disk health.
Corrupted system files. If Windows system files are locked abnormally, run sfc /scannow in Command Prompt as Administrator. This scans and repairs corrupted system files.
Permissions issues. If you consistently can’t access your own files, check ownership. Right-click the file > Properties > Security > Advanced. You should own your files.
Understanding File Handles and Locks
A file handle is Windows’ way of tracking which programs are using which files. When a program opens a file, Windows creates a handle linking that program to that file.
Handles can be:
Read-only. The program is reading data but not changing it. Multiple programs can have read-only handles simultaneously.
Write. The program can modify the file. Usually only one program can have a write handle.
Delete-on-close. The file deletes automatically when the program closes it. Temporary files work this way.
Exclusive. No other program can access the file at all.
Windows maintains these handles in kernel memory. When a program crashes, handles can leak, staying open indefinitely. This is why rebooting fixes many “in use” errors.
Common Scenarios and Quick Fixes
| Scenario | Quick Fix |
|---|---|
| Can’t delete a document | Close Word/Excel, restart File Explorer |
| Can’t eject USB drive | Close all Explorer windows, check Task Manager for transfers |
| Can’t rename a folder | Restart File Explorer, check for Command Prompt windows in that directory |
| Can’t delete a video file | Close media players, check for thumbnail generation in Task Manager |
| Can’t modify a network file | Check who has it open on the server using Computer Management |
| Can’t delete after uninstalling | Restart computer, use Safe Mode if needed |
Advanced Troubleshooting
If standard methods fail, these advanced techniques work.
Use PowerShell to Force Close Handles
PowerShell offers more control than Task Manager.
Open PowerShell as Administrator.
List all handles for a file:
Get-Process | Where-Object {$_.Modules.FileName -like "*yourfile*"}
Stop the process:
Stop-Process -Id <ProcessID> -Force
Edit Registry to Disable Auto-lock Features
Some Windows features automatically lock files. You can disable them.
Press Windows Key + R, type regedit, and press Enter.
Navigate to: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager
Find or create a DWORD value named ProtectionMode
Set it to 0 to disable some file protection features.
Restart your computer.
This is risky and can reduce system stability. Only use it if you understand the implications.
Check for Antivirus Interference
Antivirus programs scan files aggressively, locking them during scans.
Open your antivirus settings.
Find real-time protection or on-access scanning.
Add your file or folder to exclusions.
Try your operation.
Remove the exclusion afterward for security.
Analyze with Process Explorer
Process Explorer from Sysinternals provides deeper insight than Task Manager.
Download it from Microsoft’s website.
Run as Administrator.
Press Ctrl + F to search.
Enter your filename.
It shows all handles and DLLs for that file.
Right-click a handle and select “Close Handle.”
Process Explorer gives you surgical precision for stubborn locks.
Summary
“The requested resource is in use” occurs when Windows protects files that programs are currently accessing. The error prevents data corruption but blocks your work.
To fix it:
- Close all programs that might be using the file
- Restart File Explorer
- Use Resource Monitor or Task Manager to identify the locking process
- End that process
- For USB drives, disable write caching and use Disk Management to set drives offline
- For stubborn cases, boot into Safe Mode or use command-line tools
Prevention includes closing programs properly, disabling preview panes, pausing cloud sync during major operations, and restarting Windows regularly.
Most cases resolve quickly with these methods. If errors persist across restarts and affect random files, investigate malware, disk health, or system file corruption.
The tools Windows provides—Resource Monitor, Task Manager, Command Prompt—give you complete control over file locks. Learn them once and you’ll handle this error confidently every time.
Frequently Asked Questions
Why does this error happen when nothing seems to be running?
Background processes you can’t see often cause this. Windows Search indexes files constantly. Cloud sync services like OneDrive access folders invisibly. Your antivirus scans files without notification. Even File Explorer’s thumbnail generator holds files open. Use Resource Monitor to reveal hidden processes locking your files.
Can I force delete a file that’s in use without consequences?
Sometimes yes, sometimes no. If the file is a document you’ve finished with and a program forgot to close it, forcing deletion is safe. If a program is actively writing to that file, forcing deletion causes data corruption and potential program crashes. Always check what’s using the file first with Resource Monitor. Close the process properly when possible rather than force-deleting.
Will restarting my computer always fix this error?
Restarting clears all file handles and stops all processes, so it fixes the immediate error. But if the same program or background service locks the file again after restart, the error returns. Identify and disable the culprit permanently. Use Startup settings in Task Manager to prevent problematic programs from launching at boot.
How do I safely remove a USB drive that won’t eject?
First, close all windows showing files from that drive. Check Task Manager’s Performance tab to ensure no transfers are running. Go to Device Manager, find your drive under Disk Drives, open Properties, and set the policy to “Quick removal.” If it still won’t eject, use Disk Management to set the drive offline, then physically remove it. This forces Windows to release all locks.
What if the file is locked by a system process I can’t end?
Some system processes like csrss.exe or system are critical and can’t be terminated without crashing Windows. If a system process locks your file, the file is likely in use by Windows itself. Try accessing it in Safe Mode, where only essential system components run. Alternatively, boot from a Windows installation USB, open Command Prompt from recovery options, and delete the file from outside Windows entirely.
