Fix File Open in Windows Error
In this article
Yes, you can fix the 'action cannot be completed because the file is open in Windows' error by closing the program using the file, ending the process via Task Manager, or restarting your computer. This error occurs when a file or folder is locked by an application or system process, preventing deletion, moving, or renaming. Before starting, ensure you’ve saved any open work and know which files or programs might be using the resource.
What You'll Need
- A Windows PC (any recent version: 10 or 11)
- Administrator privileges (recommended for some advanced steps)
- Access to Task Manager and Windows Settings
- Optional: Command Prompt or PowerShell (for advanced troubleshooting)
Step-by-Step
- Save and close any open applications that might be using the file. This includes Word, Excel, image viewers, media players, or file explorer windows. If you’re unsure, close all non-essential programs.
- Check File Explorer. Look for any open windows that might have the file or its containing folder selected. Close them even if they appear idle — selection alone can trigger a lock.
- Press Ctrl + Shift + Esc to open Task Manager directly. Click on the 'Processes' tab to view all running applications and background tasks.
- Look through the list for any program that might be accessing the file — for example, a PDF reader if it’s a PDF, or a media player if it’s a video. Right-click the process and select 'End task'. Confirm if prompted.
- If you don’t see an obvious app, go to the 'Details' tab. Sort by 'Name' or 'PID' and look for multiple instances of common file-handling processes like 'explorer.exe', 'dllhost.exe', or 'svchost.exe'. Be cautious — only end processes you recognize.
- Right-click the suspicious process and choose 'End task'. If the file is locked by a system process, you may need to proceed carefully. Never end 'System', 'Windows Explorer', or critical services unless guided by official documentation.
- After ending the relevant process, return to File Explorer and try the original action (delete, move, rename). If it works, the lock has been released.
- If the file is still locked, restart your computer. A reboot closes all active processes and releases file locks automatically. After restart, attempt the action again before opening other programs.
- For persistent issues, open Command Prompt as Administrator. Type
net filesand press Enter. This shows files opened over a network. If your file appears, note the ID and typenet file <ID> /closeto disconnect it. - Alternatively, use the Resource Monitor. Open Start, type 'Resource Monitor', and launch it. Go to the 'CPU' tab, find the 'Associated Handles' section, and type the filename in the search box. This reveals exactly which process is holding the file. Right-click the process and select 'End Process'.
Common Mistakes
- Ending critical system processes like 'svchost.exe' or 'System' without understanding their role, which can cause instability or crashes.
- Forgetting to check background apps like cloud sync tools (OneDrive, Dropbox) — these often lock files during upload or sync.
- Assuming the file is only open in one place when multiple instances (e.g., preview pane, thumbnails) may be accessing it.
- Not restarting the PC as a last resort — a reboot is often the safest and most effective fix.
Tips
- Use the preview pane or details pane in File Explorer sparingly — they can trigger file access and cause locks.
- Disable thumbnail previews in Folder Options if you frequently work with media files — this reduces automatic file access.
- Close cloud storage apps before moving or deleting synced files to avoid sync conflicts.
- Use 'Unlocker' tools only from trusted sources — many carry malware. Built-in Windows tools are safer and sufficient in most cases.
- Always try the simplest solution first: close apps, then restart.
Troubleshooting
If the file remains locked after ending tasks and restarting, consider deeper system issues. First, boot into Safe Mode by holding Shift while clicking Restart in the Start menu. This loads Windows with minimal drivers and services. Try the file operation in Safe Mode — if it works, a third-party app is likely the culprit. Use clean boot troubleshooting via System Configuration (msconfig) to identify the offender.
If the file is on a network drive, the lock may be on another computer. Contact the network administrator or ask other users to close the file. For local files, check if antivirus software is scanning the file — temporarily disable real-time protection (only if safe to do so) and retry.
If Resource Monitor shows 'System' holding the file, it may be a paging or indexing issue. Stop the Windows Search service via Services.msc, retry the action, then restart the service. Avoid ending 'System' processes directly.
Frequently Asked Questions
Why does Windows say a file is open when I didn’t open it?
Sometimes background processes like preview panes, thumbnails, or antivirus scans access files automatically, creating a lock without user action.
Can I delete a file that’s open in another user’s session?
No — if the file is opened by another user on the same PC or over a network, you must have their permission to close it or wait until it’s released.
Is it safe to end explorer.exe?
Yes, but it will close your desktop and taskbar. It will restart automatically, or you can launch it again from Task Manager under File > Run new task > 'explorer.exe'.
What if Task Manager doesn’t show the app using the file?
Use Resource Monitor or the 'net files' command — they provide deeper visibility into system-level and network-level file access.
Can malware cause file locking issues?
Yes — malicious software can lock files to prevent removal. Run a full antivirus scan if you suspect this.
Does restarting always fix the issue?
Most of the time, yes. A restart clears all active file handles and resets system processes, resolving temporary locks.