How to Fix ‘The Action Can’t Be Completed Because the File Is Open in Another Program’ in Windows 11

Attempting to rename, move, or delete a file or folder in File Explorer on Windows 11 frequently triggers one of the most frustrating modal error dialogues in the operating system: ‘File In Use: The action can’t be completed because the file is open in [Program Name]. Close the file and try again’. In many instances, the dialogue fails to name any program at all, simply stating ‘open in another program’ even when you have completely closed every open window on your desktop. This lock occurs because an active Windows process holds an open operating system file handle on the item. Here is how to locate and terminate the locking process.

Why Does Windows 11 Lock Files in Use?

Windows enforces strict file locking semantics to prevent file corruption during read and write operations. The error activates when:

  • File Explorer Preview Pane Locks: The built-in File Explorer Preview Pane or Details Pane actively generating a live render of a PDF, image, or Office document, keeping an open read handle on the file.
  • Background Thumbnail Generation (COM Surrogate): The dllhost.exe (COM Surrogate) process extracting video or image thumbnails, holding the file open until metadata extraction completes.
  • Cloud Syncing Engines: Background syncing clients (such as Microsoft OneDrive, Google Drive, or Dropbox) actively scanning or uploading the file to the cloud.
  • Antivirus File Scanning: Real-time anti-malware scanners inspecting newly created or downloaded files for potential threat signatures.
  • Ghost or Orphaned Background Processes: An application that crashed or closed its graphical interface while its background executable process remains active in memory.

Step 1: Identify and Close the Locking Process Using Resource Monitor

Windows includes native tools capable of searching all active kernel handles to pinpoint the exact executable locking your file.

  1. Press Windows Key + R, type resmon, and press Enter to open Resource Monitor.
  2. Click on the CPU tab at the top.
  3. Locate the Associated Handles section and click the small dropdown arrow on the right to expand it.
  4. In the Search Handles text box, type or paste the exact name of your locked file (e.g., contract.pdf or report.xlsx).
  5. Review the search results:
    Process        PID      Handle Name
    explorer.exe   8420     C:\Users\User\Documents\contract.pdf
  6. Right-click the process name holding the handle and select End Process.
  7. Return to File Explorer; you can now rename, move, or delete the file immediately without error.

Step 2: Disable the File Explorer Preview Pane and Details Pane

The Preview Pane is the single most common cause of persistent file locking in File Explorer.

  1. Open File Explorer (press Windows Key + E).
  2. In the top command bar, click the View dropdown button.
  3. Hover over Show.
  4. Ensure both Preview pane and Details pane are unchecked (not highlighted).
  5. Alternatively, press Alt + P to toggle the Preview pane off.
  6. Once disabled, File Explorer releases read locks on selected PDF, Word, and Excel files immediately.

Step 3: Restart Windows Explorer in Task Manager

If File Explorer itself is holding ghost locks on folders or extracted ZIP files, restarting the shell process releases all handles.

  1. Press Ctrl + Shift + Esc to open Task Manager.
  2. In the Processes tab under Windows processes, find Windows Explorer.
  3. Right-click Windows Explorer and select Restart.
  4. Your taskbar and desktop icons will briefly flicker and refresh.
  5. Navigate back to your file and delete it.

Step 4: Force Delete the File via Elevated Command Prompt

If graphical deletion continues to fail, Command Prompt can bypass shell locks.

  1. Press Windows Key + S, type cmd, right-click Command Prompt, and choose Run as administrator.
  2. To force delete a stubbornly locked file:
    del /f /q /a "C:\Path\To\Your\LockedFile.ext"
  3. The /f flag forces deletion of read-only files, and /q enables quiet mode without confirmation prompts.

Step 5: Boot into Safe Mode for Protected Files

If third-party background drivers lock system files, Safe Mode loads only minimal drivers.

  1. Hold the Shift key while clicking Restart in the Windows Start menu.
  2. Navigate to Troubleshoot > Advanced options > Startup Settings > Restart.
  3. Press 4 on your keyboard to enter Safe Mode.
  4. Delete or move your file in Safe Mode, then restart your PC normally.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.