Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Fix: File Open in Windows Explorer Error

· 5 min read · Home Tech

In this article
  1. Why Does Windows Explorer Lock Files?
  2. Quick Fix: Close the Preview Pane
  3. Restart Windows Explorer
  4. Use a Command to Force-Close the File
  5. Check for Other Programs Locking the File
  6. Clear Thumbnail Cache
  7. Frequently Asked Questions

The "action cannot be completed because the file is open in Windows Explorer" error occurs when a file or folder is locked by Explorer, and the fix is to close the preview pane, end the Explorer process, or unlock the file. This guide explains why it happens and provides step-by-step solutions.

Why Does Windows Explorer Lock Files?

Windows Explorer (explorer.exe) is the graphical shell for Windows—it manages the desktop, taskbar, and File Explorer windows. When you open a folder, Explorer may lock certain files to read metadata, generate thumbnails, or maintain the folder view. The lock is usually temporary, but it can persist if:

  • The Preview Pane is active and displaying the file.
  • A thumbnail or icon is being generated for a large media file.
  • The file is in a folder that Explorer is actively refreshing.
  • Another program (like a media player or antivirus) is holding the file, and Explorer is trying to access it.

This error is most common with image, video, and PDF files, but it can happen with any file type that Explorer tries to preview or index.

Quick Fix: Close the Preview Pane

The most common cause is the Preview Pane, which opens a read-only copy of the selected file. To close it:

  1. Open File Explorer (Win + E).
  2. Click the View tab on the ribbon.
  3. In the Panes group, click Preview pane to toggle it off (it is highlighted when active).
  4. Try the operation again (delete, rename, move, etc.).

If the Preview Pane is already off, also check the Details Pane (same menu) and disable it as well, as it can also lock files.

Restart Windows Explorer

If closing the pane doesn't help, restart the Explorer process. This releases all locks held by Explorer, including the desktop and taskbar. To do this:

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

Your taskbar and desktop will disappear for a second and then return. This is normal. After it restarts, try the file operation again. If you prefer not to restart Explorer, you can also log off and back on, but that closes all your open programs.

Use a Command to Force-Close the File

If a specific file is locked and restarting Explorer isn't enough, you can use the command prompt to force-close the handle. This is more advanced but effective:

  1. Open Command Prompt as Administrator (search for "cmd", right-click, "Run as administrator").
  2. Type taskkill /f /im explorer.exe and press Enter. This will stop Explorer entirely.
  3. Now try to delete, rename, or move the file. If it works, great.
  4. Restart Explorer by pressing Ctrl + Shift + Esc, then in Task Manager click File > Run new task, type explorer.exe, and press Enter.

This method is useful for stubborn locks, but be aware that your desktop icons and taskbar will be gone until you restart Explorer.

Check for Other Programs Locking the File

Sometimes the error is misleading—another program is actually holding the file, and Explorer is just the messenger. Common culprits include:

  • Media players (VLC, Windows Media Player) that have the file open.
  • Photo editors (Photoshop, Paint) that are still running.
  • Antivirus scans that are temporarily accessing the file.
  • Cloud sync clients (OneDrive, Dropbox) that are uploading the file.

Close any program that might be using the file, then try again. If you can't identify the program, you can use the built-in Resource Monitor (search for it in Start) to see which processes have a handle on the file. Under the CPU tab, click Associated Handles and search for the file name.

Clear Thumbnail Cache

If the error occurs with image or video files, a corrupted thumbnail cache can cause Explorer to lock them. Clearing the cache forces Explorer to rebuild it, which often resolves the issue. To clear it:

  1. Open File Explorer and go to the View tab.
  2. Click Options (on the right side).
  3. In the View tab of the Folder Options window, check Always show icons, never thumbnails.
  4. Click OK.

This disables thumbnails, so Explorer won't lock files to generate them. You can re-enable thumbnails later if you want them back. Alternatively, you can use the Disk Cleanup tool to delete the thumbnail cache:

  1. Search for "Disk Cleanup" in Start and open it.
  2. Select your drive (usually C:) and click OK.
  3. Check Thumbnails and click OK to delete them.

This is a safe operation—it only removes temporary thumbnail images.

Frequently Asked Questions

Why does this happen specifically with Windows Explorer and not other programs?

Explorer is the default file manager, so it's always running and often the first program to access a file when you browse to it. It locks files for legitimate reasons like previewing, but the lock can persist if the file is large, corrupted, or if Explorer is busy. Other programs also lock files, but you usually see their names in the error message; Explorer is the default when no other program is obvious.

Will restarting Explorer close my open folders?

Yes, restarting Explorer will close all File Explorer windows, and you'll need to reopen them. However, it does not close other programs like Word or Chrome. Your desktop icons and taskbar will also refresh. It's a quick fix, but you'll lose your current folder view.

Is it safe to kill explorer.exe from the command prompt?

Yes, it's safe. Explorer is just the shell; killing it doesn't harm your system. Your desktop and taskbar will disappear, but you can restart it by running explorer.exe from Task Manager. If you don't restart it, you can still use other programs, but you'll have no desktop icons or taskbar.

What if the file is still locked after trying all these fixes?

If the file remains locked, it's likely held by a system process or a driver. Try restarting your computer—this releases all locks. If the problem persists after a reboot, the file may be corrupted or in use by a service. You can try using a third-party unlocker tool, but be cautious: some of these tools can cause system instability if used incorrectly. A safer option is to boot into Safe Mode and try to delete the file there, as fewer processes run in Safe Mode.

Does this error affect all versions of Windows?

The error message is most common in Windows 10 and Windows 11, but the underlying issue can occur in earlier versions like Windows 7 and 8 as well. The steps to fix it are similar, though the exact menu names may differ slightly. In Windows 7, for example, the Preview Pane is toggled from the toolbar at the top of the window, not the ribbon.