Figuring out which COM Surrogate dllhost.exe process to kill (via The Old New Thing)
Posted by jpluimers on 2026/05/25
A while ago, ejecting a CompactFlash card on Windows 10 failed with the dreaded message “The action can’t be completed because the file is open in COM Surrogate.”
I was in a hurry, and it was a long time since I bumped into a similar message, so I simply rebooted as I knew that for certainly would fix it.
Next time, these links will help me find which dllhost.exe process to kill:
- [Wayback/Archive] Wat is “COM Surrogate” (dllhost.exe) en waarom wordt het op mijn pc uitgevoerd? | Wetenschap
- [Wayback/Archive] What does the COM Surrogate do and why does it always stop working? – The Old New Thing
In other words, the COM Surrogate is the I don’t feel good about this code, so I’m going to ask COM to host it in another process. That way, if it crashes, it’s the COM Surrogate sacrificial process that crashes instead of me process. And when it crashes, it just means that Explorer’s worst fears were realized.
In practice, if you get these types of crashes when browsing folders containing video or media files, the problem is most likely a flaky codec.
Now that you know what the COM Surrogate does, you can answer this question from a customer:
I’m trying to delete a file, but I’m told that “The action can’t be completed because the file is open in COM Surrogate.” What is going on?
- [Wayback/Archive] How can I figure out which object is being hosted in an instance of dllhost? – The Old New Thing
The information is encoded in the
dllhost.execommand line. From the debugger, you can use the!pebcommand to view the command line. You can also ask Task Manager to show the command line by going to the Details page and turning on the Command line column.From the command line, extract the GUID. That is the AppId of the object loaded into the
dllhost.exeprocess. You can look up this GUID in the registry underHKEY_CLASSES_ROOT\AppId\{Guid}. That will give you some information about what the object is. To obtain the CLSID that corresponds to the AppId, go toHKEY_CLASSES_ROOT\CLSIDand search for the AppId GUID. It will be a value inside one of the CLSID entries. That’s the object.
Queries:
- [Wayback/Archive] dllhost com surrogate locks file at DuckDuckGo
- [Wayback/Archive] raymond chen dllhost at DuckDuckGo
--jeroen






Leave a comment