File operations in Windows 11—such as deleting, renaming, or editing properties—can stall when the system displays the message: The action cannot be completed because the file is open in COM Surrogate
. This error often appears even when the file isn’t open in any visible application, disrupting workflows and making file management unnecessarily complicated. The root cause usually involves the COM Surrogate process (dllhost.exe
), which Windows uses to generate file thumbnails and handle certain file previews in Explorer. When COM Surrogate becomes stuck or fails to release a file, users lose access to basic file actions until the process is reset or terminated.
End the COM Surrogate Process in Task Manager
Step 1: Press Ctrl + Shift + Esc
to launch Task Manager. This utility lets you view and control active processes on your system.
Step 2: In Task Manager, switch to the Details tab. This tab shows all running processes, including background system processes.

Step 3: Locate the process named dllhost.exe
. This represents the COM Surrogate process responsible for file previews and thumbnails.
Step 4: Right-click on dllhost.exe
and select End task. This action immediately closes the COM Surrogate process, releasing any files it was holding open. If multiple dllhost.exe
entries exist, end each one. Afterward, retry your file operation—it should proceed without the error.

Terminating COM Surrogate may also temporarily resolve issues with missing thumbnails or slow Explorer performance. Windows will automatically restart the process as needed for future file previews.
Restart Windows Explorer
Step 1: Open Task Manager (Ctrl + Shift + Esc
).
Step 2: In the Processes tab, find Windows Explorer in the list.

Step 3: Right-click Windows Explorer and choose Restart. This restarts the file management interface, which can clear temporary locks and refresh thumbnail generation. After restarting, attempt your file operation again.

This approach helps if the error is triggered by Explorer’s preview pane or thumbnail cache becoming unresponsive.
Turn Off Preview Pane and Thumbnails
Step 1: Open File Explorer and navigate to the folder containing the problematic file.
Step 2: In the Explorer window, click View in the toolbar, then select Details to change the folder view from thumbnails to a list format. This reduces Explorer’s need to generate previews, which often triggers COM Surrogate locks.

Step 3: Disable the Preview pane by clicking View > Show > Preview pane (ensure it is unchecked). This prevents Explorer from trying to preview files, which can free up locked files.

After these adjustments, retry deleting, renaming, or modifying the file.
Use File Locksmith Utility in PowerToys
Step 1: Download and install PowerToys from the Microsoft Store or this link.
Step 2: Open PowerToys and enable the File Locksmith utility in the left sidebar.

Step 3: In File Explorer, right-click the locked file and select What’s using this file? from the context menu.
Step 4: A window will display all processes currently using the file. Select any process holding the lock (such as COM Surrogate or Photos) and end it directly from this interface. This tool provides a targeted way to identify and close file handles without guessing in Task Manager.
Perform a Clean Boot to Rule Out Third-Party Interference
Step 1: Press Win + R
, type msconfig
, and press Enter
to open the System Configuration utility.

Step 2: Under the General tab, select Selective startup and check only Load system services and Load startup items.

Step 3: Go to the Services tab, check Hide all Microsoft services, then click Disable all to turn off all third-party services.

Step 4: Switch to the Startup tab and open Task Manager. Disable all non-essential startup programs by right-clicking each one and selecting Disable.

Step 5: Click OK and restart your computer. After rebooting, try your file operation again. If the error disappears, a third-party application or service may be causing the conflict. Re-enable services one by one to identify the culprit.
Disable Data Execution Prevention (DEP) for COM Surrogate
Data Execution Prevention (DEP) is a security feature that can sometimes interfere with certain processes like COM Surrogate. Disabling DEP for COM Surrogate may resolve persistent file lock issues, but it can reduce system security.
Step 1: Open an elevated Command Prompt by pressing Win + R
, typing cmd
, then pressing Ctrl + Shift + Enter
.

Step 2: Enter the following command to disable DEP globally:
BCDEDIT /SET {CURRENT} NX ALWAYSOFF

Step 3: Restart your computer. After rebooting, check if the COM Surrogate error persists. If you want to re-enable DEP later, use the following command:
BCDEDIT /SET {CURRENT} NX ALWAYSON

Only use this method if other solutions fail and you understand the security implications.
Delete Files Using Safe Mode or Command Prompt
If standard methods fail, booting into Safe Mode or using Command Prompt in Windows Recovery Environment (WinRE) can help remove stubborn files.
Step 1: Restart your computer and hold Shift
while clicking Restart in the Start menu. This opens the advanced startup menu.
Step 2: Navigate to Troubleshoot > Advanced options > Command Prompt.

Step 3: In the Command Prompt window, use cd
to navigate to the folder containing the locked file. Use del filename.ext
to attempt deletion.
This approach works because minimal system processes run in Safe Mode or WinRE, reducing the likelihood of COM Surrogate or other background processes holding file locks.
Additional Tips and Workarounds
- Some users find that opening the file, making a minor edit, saving, and closing the application can release the lock, allowing deletion.
- Disabling thumbnail previews system-wide can reduce the frequency of COM Surrogate errors. In File Explorer Options, select Always show icons, never thumbnails under the View tab.
- If the error persists across multiple files or after system updates, check for a corrupted thumbnail cache by running
cleanmgr
and selecting Thumbnails for cleanup. - For files that remain locked despite all efforts, consider using third-party utilities such as Unlocker or performing the deletion from a Linux live USB environment as a last resort.
Resolving the COM Surrogate file lock error in Windows 11 often requires ending the related process in Task Manager or adjusting Explorer’s preview settings. If these steps don’t work, deeper troubleshooting with clean boot, Safe Mode, or system utilities can usually restore normal file operations.
Member discussion