ThisCalculator

Everyday

File Is Open in COM Surrogate: Fixes That Work

Updated · Standard formula, shown below

File Is Open in COM Surrogate: Fixes That Work

If you see “File is open in COM Surrogate� when trying to delete, rename, or move a file, it means a background Windows process (dllhost.exe) is holding a lock on that file. The fix is usually to close the program that triggered the error, restart the COM Surrogate process, or in stubborn cases, restart Windows Explorer or your PC.

What Is COM Surrogate?

COM Surrogate (dllhost.exe) is a standard Windows process that runs as a host for COM objects—small software components that other programs use to do things like display thumbnails, preview videos, or extract file metadata. Windows uses it as a safety wrapper: if a third-party codec or extension crashes, the crash happens inside the surrogate instead of taking down the main application (like File Explorer).

You’ll often see multiple dllhost.exe processes running at once. That’s normal. Each one is hosting a different COM object. The “File is open in COM Surrogate� message appears when the file you’re trying to modify is currently being accessed by one of those hosted components—usually a thumbnail generator or a video preview handler.

Why Does the Error Happen?

The most common trigger is a file type that Windows tries to preview or generate a thumbnail for—especially video files (MP4, MKV, AVI) or files with third-party codecs installed. When you open a folder containing such files, Explorer asks COM Surrogate to render previews. If the codec hangs or the file is large, the surrogate keeps the file open even after you close the preview.

Other causes include:

  • Corrupted thumbnail cache
  • Outdated or buggy shell extensions (e.g., from cloud storage or image editors)
  • A file that’s genuinely still being written to by another app (like a video editor or download manager)
  • Malware masquerading as dllhost.exe (rare, but possible)

How to Fix It

Try these in order. Start with the simplest, then move to more involved steps.

  1. Close the program that might be using the file. If you just watched a video or edited a photo, close that app. Wait a few seconds, then try the operation again.
  2. Restart COM Surrogate. Open Task Manager (Ctrl+Shift+Esc), go to the “Details� tab, find all dllhost.exe entries, right-click each and select “End task.� Windows will restart them automatically when needed.
  3. Restart Windows Explorer. In Task Manager, under “Processes,� right-click “Windows Explorer� and choose “Restart.� This clears most file locks held by Explorer’s preview system.
  4. Clear the thumbnail cache. Open Disk Cleanup (search “cleanmgr� in Start), select your system drive, check “Thumbnails,� and run it. Or delete the cache manually from %LocalAppData%\Microsoft\Windows\Explorer (files like thumbcache_*.db).
  5. Disable thumbnail previews temporarily. In File Explorer, go to View → Options → View tab, check “Always show icons, never thumbnails.� If the error stops, a codec or extension is the culprit.
  6. Run a malware scan. Use Windows Defender or a reputable third-party scanner to rule out a fake dllhost.exe.
  7. Restart your PC. This is the nuclear option that always works, because it releases every file lock.

Preventing the Error in the Future

If you see this error often, the root cause is likely a broken codec pack or a shell extension that misbehaves. Consider:

  • Uninstalling recently added codec packs or video editing software.
  • Updating your video drivers and codec packs to the latest stable versions.
  • Using a lightweight media player that doesn’t register itself as a thumbnail provider.
  • Running the built-in Windows Troubleshooter for “System Maintenance� (search “troubleshoot� in Settings).

Is COM Surrogate Safe?

Yes, the real dllhost.exe is a legitimate Windows component. It lives in C:\Windows\System32 and is signed by Microsoft. However, malware can disguise itself with the same name. To check: right-click dllhost.exe in Task Manager, select “Open file location.� If it opens to System32, it’s almost certainly genuine. If it opens to a user folder or a temp directory, run a full antivirus scan immediately.

Frequently Asked Questions

Can I delete dllhost.exe to fix the error?

No. Deleting or disabling dllhost.exe will break thumbnail previews and other Windows features. It’s a core system file. Instead, end the process from Task Manager—Windows will restart it as needed.

Why does this happen with video files but not photos?

Video files require codecs to decode a frame for the thumbnail. Third-party codecs are more prone to hanging or holding file handles than the built-in image decoders. Photos use Windows’ native imaging code, which is more reliable.

Does the error mean my file is corrupted?

No. The error is about file access, not file integrity. Your file is likely fine. The issue is that another process won’t release its lock on it.

Will restarting Explorer close my open folders?

Yes, File Explorer will close and reopen. Any open Explorer windows will be restored automatically in most Windows 10/11 versions, but unsaved work in other apps is unaffected.

What if the error appears on a network drive?

If the file is on a network share, the lock might be held by another computer’s process. Ask the other user to close the file, or wait a few minutes for the lock to expire. On your end, you can also disconnect and reconnect the network drive.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.