|

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

StepWhat to do
1. Close the programClose the app that opened the file and save your work first
2. Open File LocksmithRight-click the file, select Show more options, then Unlock with File Locksmith
3. End the processSelect End task next to the process that holds the file
4. Try againDelete, move or rename the file once the list is empty
5. Scan everythingIf the process is missing, select Restart as administrator in File Locksmith
6. Use a fallbackTry 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.

CauseWhat happens
Antivirus scanA scan can keep a system-level handle open after the app that used the file has closed
Another device on your networkA PC that recently opened the file over the network can still hold a handle
A file loaded as a DLLIt 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

  1. Close the program that opened the file, and any preview or editing window for it.
  2. Press Ctrl + Shift + Esc to open Task Manager.
  3. On the Processes tab, look for the program, select it, and choose End task.
  4. 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.

  1. Install PowerToys by following the steps on Microsoft’s install page.
  2. Open PowerToys and turn on the Enable File Locksmith toggle.
  3. In File Explorer, select the locked file or folder.
  4. Right-click it and select Show more options.
  5. Select Unlock with File Locksmith.
  6. 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.

OptionWhat it does
<path>Required, one or more file or folder paths separated by spaces
–killEnds every process locking the files
–jsonPrints the results as JSON
–waitWaits 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.

  1. Download Handle from the Sysinternals Handle page and unzip it.
  2. Open Terminal or Command Prompt as administrator and go to the folder with the files.
  3. Run handle followed by part of the file name.
  4. Read the process name and ID shown on the left of each match.
  5. Close that program normally, then try again.
OptionWhat it does
-p <process>Limits the scan to processes whose names start with the text
-uShows the owning user name
-aLists every handle type, not only files
-c <handle>Closes a handle by its hexadecimal value, with the process ID given using -p
-ySkips 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.

  1. Open Process Explorer.
  2. Press Ctrl + Shift + F to open the Find Handle or DLL window, as Windows Latest describes it.
  3. Type the name of the locked file.
  4. Select the result to see the process that holds it.
  5. Close the handle or end the process, then retry the deletion.

Download it from the Process Explorer page.

Which tool should you use

ToolTypeBest for
File LocksmithRight-click menu in File ExplorerMost people, one file or a whole folder
HandleCommand line, needs adminSearching by part of a file name
Process ExplorerGraphical window with a search boxSeeing 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.

  1. Rename the locked file, if Windows allows it.
  2. Put a fresh copy with the original name in the same folder.
  3. 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.

Sources

Leave a Reply

Your email address will not be published. Required fields are marked *