How to Fix File Is Open in Another Program Error in Windows 11

The “File is open in another program” error is one of the most annoying issues you can run into on Windows 11. It usually appears when you try to delete, rename, or move a file — only for Windows to insist that some mysterious program is still using it. Most of the time, the file isn’t visibly open anywhere, which makes the situation even more frustrating.

The good news is that this problem is completely fixable. Whether the file is locked by File Explorer, a background app, a Windows service, or even a stuck process, we’ll walk you through all the working methods to unlock the file and get rid of the error.

Why Windows Shows the “File Is Open in Another Program” Error

This error typically happens when:

  • A background app is using the file
  • File Explorer has a preview or thumbnail lock on the file
  • The file is used by Windows Indexing
  • The file is syncing with OneDrive or Google Drive
  • Antivirus software is scanning the file
  • A hidden or crashed process is still locking it
  • The file is marked “in-use” due to corruption

Now let’s apply the solutions.

1. Close All Apps That Might Be Using the File

Before moving to advanced fixes, start with the basics:

  1. Close apps like:
    • Word
    • Excel
    • Photoshop
    • VLC
    • Notepad
    • Browsers
  2. Try deleting or renaming the file again.

This often works if the file is actually still open without you realizing it.

2. Restart File Explorer (Quickest Fix)

File Explorer often locks files due to previews or thumbnail generation.

  1. Press Ctrl + Shift + Esc to open Task Manager.
  2. In the Processes tab, find Windows Explorer.
  3. Right-click → Restart.

Now try the file operation again.

3. Use Task Manager to Find and End the Program Locking the File

Task Manager can help you locate processes using the file.

  1. Open Task Manager.
  2. Click More details (if needed).
  3. Look for suspicious processes:
    • Microsoft Office apps
    • Media players
    • Browsers
    • Cloud sync apps
    • Editors like Notepad++, VS Code
  4. Select the app → Click End task.
  5. Try accessing the file again.

4. Disable File Explorer Preview Pane (Prevents File Locks)

The preview pane sometimes locks files, especially images, PDFs, and videos.

  1. Open File Explorer.
  2. Click View in the ribbon.
  3. Turn Preview Pane off.

Now retry deleting or renaming the file.

5. Turn Off File Explorer Thumbnails

Thumbnails can lock large photos, videos, and PSD files.

  1. Press Windows + R, type control folders, press Enter.
  2. In the View tab:
    • Check Always show icons, never thumbnails
  3. Click Apply → OK.
  4. Restart File Explorer.

6. Stop OneDrive or Google Drive Sync

Cloud services frequently lock files during syncing.

Stop OneDrive syncing:

  1. Right-click the OneDrive icon in the tray.
  2. Choose Pause syncing.
  3. Pick 2 hours.

Stop Google Drive:

  1. Click the Google Drive icon.
  2. Choose Pause syncing.

Try accessing the file again.

7. Restart Your PC (Simple but Often Works)

A quick restart resets all processes holding onto the file.

  1. Click Start.
  2. Choose Power → Restart.

After rebooting, try the file operation again.

8. Use Resource Monitor to Check Which Program Is Locking the File

If you want precision:

  1. Press Windows + R, type resmon, press Enter.
  2. Go to the CPU tab.
  3. Expand Associated Handles.
  4. Search the locked file’s name.
  5. Right-click the locking process → End process.

This is one of the most accurate ways to find the culprit.

9. Empty the Windows Temp Folder

Temporary files being locked can block adjacent files.

  1. Press Windows + R, type %temp%, press Enter.
  2. Select everything → Delete.

This clears stuck temporary processes.

10. Disable Indexing for the File or Folder

Windows Search Indexing can briefly lock files.

  1. Right-click the problematic folder.
  2. Click Properties.
  3. Select Advanced.
  4. Uncheck Allow files in this folder to have contents indexed.
  5. Click OK.

Wait a few seconds, then retry.

11. Boot into Safe Mode and Delete the File

Safe Mode loads minimal drivers and prevents background apps from locking files.

  1. Press Windows + ISystem → Recovery.
  2. Under Advanced startup, click Restart now.
  3. Go to Troubleshoot → Advanced options → Startup Settings → Restart.
  4. Press 4 to enter Safe Mode.

Now delete or rename the file.

12. Delete the File Using Command Prompt

A stuck Windows process won’t block Command Prompt as easily.

  1. Press Windows + XWindows Terminal (Admin).
  2. Use: del /f /q "filepath"

Example:

del /f /q "C:\Users\Name\Desktop\lockedfile.mp4"

This forces deletion.

13. Use a Third-Party Unlocker Tool (Last Resort)

If nothing works, these tools can force-delete locked files:

  • LockHunter
  • IObit Unlocker
  • Unlocker

These tools show which program is locking the file and help unlock and delete it safely.

Wrapping Up

The “File is open in another program” error can be incredibly frustrating, especially when you’re trying to clean up storage or organize your files. Thankfully, once you restart File Explorer, close background apps, pause cloud sync tools, or identify the locking process using Task Manager or Resource Monitor, the issue usually goes away quickly.

Posted by Arpita

With a background in Computer Science, she is passionate about sharing practical programming tips and tech know-how. From writing clean code to solving everyday tech problems, she breaks down complex topics into approachable guides that help others learn and grow.

X