Windows "file is open in another program": causes and fixes
Windows shows this when a running program still holds the file open, so it can't be deleted, moved or renamed. If the dialog names a program, save your work and close it, then try again. If no program is named, press Alt+P in File Explorer to turn off the Preview pane. If that doesn't work, restart Windows Explorer from Task Manager or restart the PC.
What this message means
When a program opens a file, Windows gives that program a "handle" to it and can block other actions on the file until the handle is released. The "File In Use" dialog means something still has the file open, so you can't delete, rename or move it. That something might be an app you left open, a background process, File Explorer itself (for example while it draws a preview or thumbnail), a sync client like OneDrive, or antivirus scanning the file. For a folder, the dialog says "Folder In Use" and "the folder or a file in it is open in another program". The file is not damaged. You just need to find and close whatever is holding it.
Common causes
| Cause | How to tell |
|---|---|
| The file is still open in an app | The dialog often names the program, for example "because the file is open in Microsoft Word" or "Adobe Acrobat". You may also see the app's icon on the taskbar, or a hidden temporary file such as ~$report.docx next to the file. |
| File Explorer's Preview pane or Details pane is reading the file | The error happens right after you click the file in File Explorer and a preview shows on the right side of the window. Closing the pane or selecting a different file lets the action go through. |
| File Explorer (explorer.exe) is stuck on the file while making a thumbnail | The dialog says the file is open in "Windows Explorer" or doesn't name any program. It happens most with videos, images and PDFs in folders set to thumbnail views. |
| A closed program left a background process running | You already closed the app, but Task Manager still lists it under Background processes, or Resource Monitor shows its process with a handle to the file. |
| OneDrive, Dropbox, backup software or antivirus is using the file | The file sits in a synced folder (its status column shows a syncing icon) or it was just downloaded or created. The error goes away by itself after a minute or after you pause syncing. |
| Another user or computer has the file open on a shared network drive | The file is on a mapped drive or network share, nothing on your PC is using it, and Resource Monitor on your machine shows no handle to it. |
How to fix it
1. Close the program named in the dialog
- Read the dialog. If it says "open in" followed by a program name, switch to that program.
- Save your work and close the file, or close the program fully.
- Check the system tray (the up arrow near the clock) for the same app still running, and quit it there if present.
- Go back to the dialog and click Try Again.
2. Turn off the Preview pane and Details pane in File Explorer
Windows 11: View > Show menu. Windows 10: View tab on the ribbon. Keyboard shortcuts work on both.
- In File Explorer, press Alt+P to toggle the Preview pane off (or press Alt+Shift+P for the Details pane).
- Windows 11: click View > Show and make sure Preview pane and Details pane are unticked.
- Windows 10: open the View tab and make sure Preview pane and Details pane are not highlighted.
- Click an empty spot in the folder so the file is not selected, then try the delete, move or rename again.
3. Restart Windows Explorer
- Press Ctrl+Shift+Esc to open Task Manager.
- On the Processes tab, find Windows Explorer (click More details first on Windows 10 if you only see a short list).
- Right-click Windows Explorer and choose Restart. The taskbar and desktop will disappear for a second and come back.
- Open File Explorer again and repeat the action.
4. Find the locking process with Resource Monitor and end it
- Press Windows+R, type resmon and press Enter.
- Open the CPU tab and expand Associated Handles.
- Type the file or folder name into the Search Handles box and press Enter.
- Note the process in the Image column. If it's an app you recognise, close it normally. Otherwise, right-click the process and choose End Process (unsaved work in that app will be lost).
- Don't end system processes such as System, csrss.exe or svchost.exe. If one of those holds the file, restart the PC instead.
- Try the action on the file again.
5. Use PowerToys File Locksmith or Sysinternals Handle
Needs Microsoft PowerToys (File Locksmith) or the free Sysinternals Handle tool. Handle requires administrator rights.
- File Locksmith: open PowerToys and turn on Enable File Locksmith.
- In File Explorer, right-click the file or folder. On Windows 11, choose Show more options, then Unlock with File Locksmith.
- If the list looks incomplete, click Restart as administrator so it can see processes owned by other users and services.
- Click End task on the process holding the file, then retry.
- Command-line alternative: open Command Prompt as administrator, run handle.exe followed by part of the file name (for example handle report.docx), and close the process listed next to the matching path.
6. Pause syncing or restart the PC
- If the file is in a OneDrive folder, click the OneDrive cloud icon near the clock, select the Settings gear, choose Pause syncing, then try again. Resume syncing afterwards.
- Pause other sync or backup tools (Dropbox, Google Drive) the same way from their tray icons.
- If nothing else works, save your work and choose Start > Power > Restart (not Shut down, which can keep Fast Startup state). Then delete, move or rename the file before opening any apps.
- If the file is still locked after a restart, try the action again in Safe Mode, where most third-party apps and sync clients don't start.
Next time, skip the search
Crade is an AI assistant for Mac and Windows that sees your screen. When a message like this pops up, ask “what does this mean?” and it explains the exact error in front of you, step by step.
Download CradeStill not fixed?
If the file is still locked after a restart and in Safe Mode, run Resource Monitor or File Locksmith as administrator. That shows processes from services and other signed-in users that a normal search misses. For files on a network share or company server, someone else probably has the file open. Ask them to close it, or ask your IT admin to close the open file session in Computer Management (Shared Folders > Open Files) on the server. If antivirus has quarantined or is scanning the file, check its history or quarantine screen. If a file you can't identify keeps locking after every reboot, run a full malware scan with Windows Security.
Questions people ask
How do I find out which program has a file open in Windows?
Open Resource Monitor (Windows+R, type resmon), go to the CPU tab and type the file name into the Search Handles box under Associated Handles. The Image column shows the process holding it. PowerToys File Locksmith shows the same thing from the right-click menu.
Why does it say the file is open in Windows Explorer when I haven't opened it?
File Explorer reads the file to draw its preview or thumbnail, and sometimes doesn't let go. Turning off the Preview pane with Alt+P or restarting Windows Explorer from Task Manager usually releases it.
Can I force delete a file that is open in another program?
Windows has no built-in force-delete option, so first close or end the process holding the file. Restarting the PC always releases a lock held by a normal app. Closing a handle directly with tools like Handle -c can crash the program holding it or make Windows unstable.
Why can't I delete a folder even though no files in it are open?
A Command Prompt, PowerShell or terminal window whose current directory is inside the folder counts as having it open, and so does a program that last saved there. Close those windows, or search the folder path in Resource Monitor's Associated Handles to find what's using it.
Will restarting the computer delete or damage the file?
No. Restarting only closes the programs holding the file. The file stays where it is, and you can delete, move or rename it once Windows starts again.
Sources
- File Locksmith utility for Windows - PowerToys (Microsoft Learn)
- Handle - Sysinternals (Microsoft Learn)
- The action cannot be completed because the file is open in another program (Microsoft Q&A)
- Windows "You need permission to perform this action": fix it
- Windows "Activate Windows" watermark: what it means and how to fix it
- Windows activation error 0xC004F074: what it means and how to fix it
- Application was unable to start correctly (0xc000007b): fix
- Windows "No Audio Output Device is installed": causes and fixes
- Windows Automatic Repair couldn't repair your PC: fixes