Fix ERROR_BAD_SERVICE_ENTRYPOINT 0x00000262 on Windows Server
Service callback entrypoint is corrupted or missing. Usually from a bad driver install or registry edit. Here's how to fix it fast.
What's actually happening here
Windows Service Control Manager (SCM) loads a service and tries to call its initialization callback — usually ServiceMain. When you see ERROR_BAD_SERVICE_ENTRYPOINT (0x00000262), SCM can't find that entrypoint in the service's executable. The error message says The %hs service is not written correctly because the service binary is missing the expected function, or the registry points to the wrong DLL or entrypoint name.
This crops up most often after a failed driver update, a third-party antivirus removal that nukes a system service, or a botched registry tweak. On Windows Server 2019, I've seen it hit SysMain (Superfetch) after a driver rollback. On Server 2022, it's usually from a backup agent that replaces ntdll.dll stubs.
Let's walk through fixes. Stop when your issue is gone.
Fix 1: 30 seconds — Check the service's binary and entrypoint in registry
This is the quickest check. Open regedit.exe as Administrator. Navigate to:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\<YourServiceName>
Look at these values:
ImagePath— full path to the executable. Does the file exist? Right-click the path and choose Copy, then paste into File Explorer. If it's missing, you've found the problem — reinstall the software that owns it.ServiceDll(underParameterssubkey) — if present, this tells SCM which DLL to load. Check that file exists too.ServiceMain(underParameters) — the entrypoint name. Default isServiceMain. If it's blank or wrong, SCM won't find the callback.
Real scenario: A user installed a VPN client that replaced the RasMan service's ServiceDll with its own. Uninstalling the VPN left the registry pointing to a deleted DLL. Error 0x00000262 appeared at boot. Fix: restored the original ServiceDll path.
If the file is present and the entrypoint looks normal, move to Fix 2.
Fix 2: 5 minutes — Re-register the service DLL
If the service uses a DLL (most do — ServiceDll key exists), re-register it with the system. Open Command Prompt as Administrator and run:
regsvr32 /u "C:\Path\To\YourService.dll"
regsvr32 "C:\Path\To\YourService.dll"
Replace the path with yours. regsvr32 re-registers COM components and refreshes the DLL's exported functions. This fixes cases where a partial update left the entrypoint table mangled.
Why this works: regsvr32 calls DllRegisterServer, which rewrites the DLL's registration in the registry. But more importantly, it forces Windows to re-read the DLL's export table. If the table was corrupted in memory (e.g., after a crashed install), this reloads it cleanly.
Still broken? Move on.
Fix 3: 15+ minutes — System File Checker + DISM + services backup
This is the heavy artillery. Run these in order:
- Open Command Prompt as Administrator.
- Run
sfc /scannow. This checks all protected system files and replaces corrupted ones from the local cache. Wait for it to finish — takes 5-10 minutes on a server. - If SFC finds issues but can't fix them (common on Server 2019 with a corrupted component store), run
DISM /Online /Cleanup-Image /RestoreHealth. This pulls fresh files from Windows Update. If your server has no internet, use a mounted ISO:DISM /Online /Cleanup-Image /RestoreHealth /Source:C:\mount\windows\sxs /LimitAccess. - Reboot.
If the error persists, the service itself might be from a third party. Open Services.msc, find the broken service, double-click it, and note the Service name. Then run:
sc queryex <ServiceName>
Look at BINARY_PATH_NAME. If it's a driver (.sys file in C:\Windows\System32\drivers), you have two options:
- Disable the driver via
sc config <ServiceName> start=disabledand reboot. Only do this if you don't need the hardware or software it drives. - Restore the original driver from the manufacturer's site. Use Device Manager to find the device, right-click, Properties → Driver → Update Driver → Browse my computer → point to the downloaded
.inf.
When you should just nuke the service
If this is a leftover from an uninstalled application (e.g., a backup agent you removed weeks ago), delete the entire registry key under Services. Export a backup first: right-click the key → Export. Then delete the key. Reboot. The error disappears because SCM stops trying to load the dead service.
Why the error code is 0x00000262 and not something else
The error code maps to ERROR_BAD_SERVICE_ENTRYPOINT in winerror.h. The exact number (610 decimal) is STATUS_BAD_ENTRYPOINT in NT status codes. When SCM calls CreateService or starts a service, it uses LoadLibraryEx and GetProcAddress internally. If GetProcAddress returns NULL for the entrypoint name, SCM translates that NT status to ERROR_BAD_SERVICE_ENTRYPOINT. That's the whole chain.
What's not obvious: the entrypoint can be mangled by a security product that injects into every process' address space. I've seen CrowdStrike and SentinelOne do this — they hook LdrLoadDll and sometimes corrupt the export table. If you suspect your AV, temporarily disable it and retry Fix 2.
One last check: the service executable's dependencies
Use Dependency Walker (or dumpbin /imports) on the service's binary. If it depends on a DLL that's missing (like msvcr120.dll on a fresh Server 2022 install), the entrypoint never loads. Install the Visual C++ redistributable for the relevant year. That's a 30-second download from Microsoft's site.
If none of this works, you're looking at a corrupt OS installation. At that point, DISM /Online /Cleanup-Image /RestoreHealth with a known-good source is your last resort before a repair install.
Was this solution helpful?