How To Fix A File Open In Another Program In Windows 11 (2026)
Windows 11 blocks you from deleting, moving or renaming a file when it says the file is open in another program.
The program holding the file is often one you already closed, so the fix is to find the process that still has a handle on it.
The steps below use Microsoft’s PowerToys File Locksmith and Sysinternals tools, with a rename and a restart as the fallbacks.
File in use quick answer
| Step | What to do |
|---|---|
| 1. Close the program | Close the app that opened the file and save your work first |
| 2. Open File Locksmith | Right-click the file, select Show more options, then Unlock with File Locksmith |
| 3. End the process | Select End task next to the process that holds the file |
| 4. Try again | Delete, move or rename the file once the list is empty |
| 5. Scan everything | If the process is missing, select Restart as administrator in File Locksmith |
| 6. Use a fallback | Try Handle, Process Explorer, a rename or a restart |
Why Windows says a file is in use
Windows creates a file handle each time a program opens a file, and it blocks deletion or renaming while that handle exists.
Windows Latest reports that Microsoft Azure CTO Mark Russinovich explained why closing the visible window does not always release every handle.
| Cause | What happens |
|---|---|
| Antivirus scan | A scan can keep a system-level handle open after the app that used the file has closed |
| Another device on your network | A PC that recently opened the file over the network can still hold a handle |
| A file loaded as a DLL | It is mapped into a process’s memory, so only ending the whole application releases it |
That is why the same error can appear when nothing seems to be running.
Start with the simple checks
- Close the program that opened the file, and any preview or editing window for it.
- Press Ctrl + Shift + Esc to open Task Manager.
- On the Processes tab, look for the program, select it, and choose End task.
- Try to delete, move or rename the file again.
Ending a process closes anything you have not saved, so save your work before you do it.
If the file is on a shared drive, remember that another device may be the one holding it.
Find the lock with File Locksmith
File Locksmith is part of Microsoft PowerToys, and Microsoft’s documentation says it lists the processes using the files you select.
- Install PowerToys by following the steps on Microsoft’s install page.
- Open PowerToys and turn on the Enable File Locksmith toggle.
- In File Explorer, select the locked file or folder.
- Right-click it and select Show more options.
- Select Unlock with File Locksmith.
- Select End task next to the process that holds the file.
If you select a folder, File Locksmith also scans the files and subfolders inside it.
Processes run by a different user cannot be accessed and may be missing from the list.
To scan every process, select Restart as administrator in the File Locksmith window.
Ended processes drop off the list automatically, and Reload refreshes it by hand.
Use File Locksmith from the command line
PowerToys also installs PowerToys.FileLocksmith.CLI.exe, and it adds its bin folder to PATH, so open a new terminal if one was already running.
| Option | What it does |
|---|---|
| <path> | Required, one or more file or folder paths separated by spaces |
| –kill | Ends every process locking the files |
| –json | Prints the results as JSON |
| –wait | Waits until the files are released |
| –timeout <ms> | Used with –wait, returns exit code 1 if the files are still locked |
For example, PowerToys.FileLocksmith.CLI.exe "C:\Users\Docs\report.docx" lists what is locking that file.
If you need an elevated window, see our guide to opening Terminal as administrator.
Check open handles with Handle
Handle is a Sysinternals command-line tool, and Microsoft’s page says it needs administrative privileges.
- Download Handle from the Sysinternals Handle page and unzip it.
- Open Terminal or Command Prompt as administrator and go to the folder with the files.
- Run
handlefollowed by part of the file name. - Read the process name and ID shown on the left of each match.
- Close that program normally, then try again.
| Option | What it does |
|---|---|
| -p <process> | Limits the scan to processes whose names start with the text |
| -u | Shows the owning user name |
| -a | Lists every handle type, not only files |
| -c <handle> | Closes a handle by its hexadecimal value, with the process ID given using -p |
| -y | Skips the confirmation prompt when closing a handle |
Microsoft’s page warns that closing handles can cause application or system instability.
Use -c only when you cannot close the program the normal way.
Search for the file in Process Explorer
Process Explorer is the graphical version of Handle, and it runs without installing when you open procexp.exe.
Microsoft’s page lists Windows 11 as the client requirement and says its search shows which processes have a handle open.
- Open Process Explorer.
- Press Ctrl + Shift + F to open the Find Handle or DLL window, as Windows Latest describes it.
- Type the name of the locked file.
- Select the result to see the process that holds it.
- Close the handle or end the process, then retry the deletion.
Download it from the Process Explorer page.
Which tool should you use
| Tool | Type | Best for |
|---|---|---|
| File Locksmith | Right-click menu in File Explorer | Most people, one file or a whole folder |
| Handle | Command line, needs admin | Searching by part of a file name |
| Process Explorer | Graphical window with a search box | Seeing every handle and DLL a process has open |
Rename the file when you cannot end the process
Windows Latest recommends a rename workaround when you cannot close the process that holds the file right away.
- Rename the locked file, if Windows allows it.
- Put a fresh copy with the original name in the same folder.
- Delete the renamed old copy after the holding process releases it.
Programs that need the file will use the new copy in the meantime.
If the file is a DLL
A file loaded as a DLL does not show up as a normal file handle.
Windows Latest says the only way to release it is to end the whole application that has it loaded.
If the file is still locked
- Restart the PC, then delete the file before you open other programs.
- Check whether your antivirus is scanning the file, because a scan can hold a handle after the app has closed.
- If File Explorer itself freezes while you try, read our guide to File Explorer not responding.
- To work without third-party programs loading, you can start Windows 11 in Safe Mode.
If you deleted the wrong file along the way, our guide to recovering deleted files in Windows 11 covers the Recycle Bin and File History.