0X00000887

Fix Service Control Error 0X00000887 (NERR_ServiceEntryLocked)

Server & Cloud Intermediate 👁 10 views 📅 Jun 10, 2026

Error 0X00000887 means the Service Control Manager can't process a lock command on a service. Here's how to fix it fast.

What This Error Means (and what not to do)

Error code 0X00000887 (decimal 2185 for those keeping score) is the Windows Service Control Manager's way of saying "this service's control entry is locked right now." It pops up when you try to stop, restart, or reconfigure a service using net stop, sc control, or the Services GUI, and the SCM is already processing a start or stop command for that same service.

I've seen this most often after a service fails to start cleanly — it leaves the lock behind. Also common when someone clicks "Restart" in Services.msc before the previous stop finishes. It's not a corruption. It's a timing problem, and you can fix it without rebooting.

Fix #1: The 30-Second Check — Wait and Retry

This is the honest fix: just wait. Give the SCM 30 seconds to clear the lock on its own.

  1. Open a Command Prompt as Admin. Right-click Start, choose "Command Prompt (Admin)" or "Windows Terminal (Admin)".
  2. Type sc queryex <servicename>. Replace <servicename> with the actual service name. For example: sc queryex spooler for the Print Spooler.
  3. Look at the STATE output. If it says "STOP_PENDING" or "START_PENDING", the lock is normal — the service is still transitioning. Wait 15 seconds and run the query again.
  4. Once STATE shows "STOPPED" or "RUNNING", try your original command again.

Expected outcome: After 30-60 seconds, the lock clears automatically. If it doesn't, move to Fix #2.

Fix #2: The 5-Minute Fix — Kill the Stuck Process

Skip this if the service is critical to your system (like RpcSs). This works when the service's process is hung and won't respond to SCM commands.

  1. First, find the PID. Run sc queryex <servicename> and note the PID number under STATE.
  2. If the PID is 0, the service process is already dead — jump to Fix #3.
  3. If PID is something like 1234, open Task Manager (Ctrl+Shift+Esc) or run taskkill /f /pid 1234 from an Admin Command Prompt.
  4. After killing it, run sc queryex <servicename> again. You should see STATE = STOPPED and PID = 0.
  5. Now the lock is gone. Start the service with net start <servicename> or sc start <servicename>.

Expected outcome: The process ends, SCM releases the lock, and you can control the service again. If the PID was 0 already, you need the next fix.

Fix #3: The 15+ Minute Fix — Clear the Lock from the Registry

This is the nuclear option, and it's the real fix for error 0X00000887 when the service process is already dead but the SCM still thinks it's locked. This happens when a service crashes cleanly but the SCM doesn't get the message. Happens on Windows Server 2016 and 2019 more than 10 or 11, but I've seen it on both.

You're editing the registry. Back it up first if you're nervous.

  1. Open Regedit as Admin. Type regedit in the Start menu, right-click, choose "Run as administrator".
  2. Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\<servicename>.
  3. On the right, look for a value named Start. Double-click it. Write down the current value — you might need it later. Usually it's 2 (Automatic), 3 (Manual), or 4 (Disabled).
  4. Change the Start value to 4 (Disabled). Click OK.
  5. Close Regedit. Open an Admin Command Prompt.
  6. Run sc query <servicename>. It should say STATE = STOPPED. If it still says START_PENDING or STOP_PENDING, reboot the machine. The lock will be gone after reboot.
  7. Once the service is stopped, change the Start value back to its original number (2, 3, or whatever you wrote down).
  8. Now start the service: net start <servicename>.

Expected outcome: The service starts cleanly. The error 0X00000887 won't appear again unless you have a deeper problem like a corrupted service binary or a driver conflict.

What If None of These Work?

If you're still seeing 0X00000887 after all three fixes, you've got something more serious. Check the System Event Log (Event Viewer > Windows Logs > System) for events from source "Service Control Manager" around the time the error appears. Look for event ID 7034 (service crashed unexpectedly) or 7000 (service failed to start).

Also check for antivirus software interfering. I've seen Symantec Endpoint Protection and McAfee lock service entries on Server 2012 R2. Temporarily disable the AV and see if the error goes away.

Last resort: run sfc /scannow from an Admin Command Prompt to check for system file corruption. Then dism /online /cleanup-image /restorehealth. These rarely fix this specific error, but they rule out bigger problems.

If you're still stuck, post the exact service name, the full error message, and any event IDs from the System log. I'll help you nail it down.

Was this solution helpful?