You want to delete, rename or move a file, and Windows 11 refuses, saying it is open in a program? Windows protects a file as long as a process keeps it open: this is not a fault, but you need to identify that process. This guide offers a progression from the simplest to the most technical, with Microsoft's free tools (PowerToys File Locksmith, and Process Explorer and Handle from Sysinternals). The steps also apply to Windows 10, unless stated otherwise.
Typical message (the program name varies):
File In Use
The action can't be completed because the file is open in Microsoft Word.
Close the file and try again.
Observe before acting
| Observation | Most likely cause | Step |
|---|---|---|
| The message names a program | That program has the file open, sometimes in a hidden or minimised window | Step 1 |
| The message mentions "another program" or Windows Explorer | Preview, thumbnail or File Explorer window keeping the file open | Step 2 |
| The program is closed but the lock remains | Process still running in the background | Steps 3 and 4 |
| The lock disappears after a restart, then comes back | Program started at boot, sync or scan reopening the file | Step 5 |
| The file is in the Recycle Bin | Covered in a dedicated guide | Recycle Bin won't empty on Windows 11 (French guide) |
Step 1: close the file in the named program
When to use it: the message gives the name of the program.
Expected result: the deletion, renaming or move succeeds.
Step 2: release File Explorer
When to use it: no program is named, or the message mentions Windows Explorer.
Expected result: the file is deleted. Otherwise, restarting the PC releases all open files: it is the simplest solution if you don't need to know which program was locking it.
Step 3: find the program with PowerToys File Locksmith
When to use it: you want to know which process is locking the file, on Windows 11 or Windows 10 (version 2004 or later).
File Locksmith is a Microsoft PowerToys module that shows the processes using a file or folder.
Expected result: no process is listed any more and the operation on the file works.
Rollback: PowerToys can be uninstalled like any app, from Settings > Apps > Installed apps.
Step 4: search for the file with Process Explorer or Handle
When to use it: you don't want to install PowerToys, or you prefer Microsoft's Sysinternals tools (no installation needed).
Expected result: you know which program is locking the file and can close it.
Process Explorer and Handle can also force-close a "handle" (a program's access to the file). Microsoft warns that this can make the program, or even the system, unstable, with a risk of losing unsaved data. Always prefer closing the program normally or restarting.
Step 5: lock that comes back at every startup
When to use it: the file is released after a restart, then gets locked again.
Expected result: the file is deleted. Then re-enable automatic startup or syncing if you need it.
Special cases
| Situation | What to do |
|---|---|
| The message says access denied rather than file open | This is not a lock but a permissions problem (owner or NTFS permissions of the folder): the tools in this guide won't change anything. See Access denied to a folder in Windows 11. |
| The file is a program currently in use | Quit the corresponding program, including from the notification area, before deleting its file. |
| The locking process is System | Often a network share or access from another PC: close the file on the other device, or restart. |
| File Explorer freezes during the operation | See Windows 11 File Explorer is slow, freezes or closes by itself (French guide). |
Final check
- ☐ The program that was locking the file is identified or closed.
- ☐ The file is deleted, renamed or moved without a message.
- ☐ No handle was force-closed on a file being written.
- ☐ Paused automatic startup or syncing has been re-enabled if needed.
Sources
- Microsoft Learn: PowerToys File Locksmith utility
- Microsoft Learn: Install PowerToys
- Microsoft Learn (Sysinternals): Process Explorer
- Microsoft Learn (Sysinternals): Handle
Still having the problem?
Reply in this topic with your Windows version (Windows + R keys, then winver), the exact message, the file type and its location (internal drive, USB stick, OneDrive folder, network share), and the name of the process found by File Locksmith, Process Explorer or Handle. Replace your user name with "USER" in paths.