Device Manager Code 40 — Windows Cannot Access This Hardware (Service Key Missing)
| Code | Code 40 |
|---|---|
| Applies to | Windows device (any brand) |
| Severity | User-fixable |
| Most common cause | The driver's registry service key was deleted or its values damaged (registry cleaners, failed installs) |
What this code means
Code 40: 'Windows cannot access this hardware because its service key information in the registry is missing or recorded incorrectly.' Every driver registers a service key in the registry — where its files live, how it starts, what it depends on. If that key is missing or its values are wrong, Windows cannot even begin to load the driver.
It is a close cousin of Code 19 (damaged device configuration), but here the damage is specifically in the driver's service registration — and the clean fix is the same: let the manufacturer's installer write it again.
Likely causes
- The driver's registry service key was deleted or its values damaged (registry cleaners, failed installs)
- A partial uninstall removed the service key but left the device entry
- Malware or a disk error damaged the registry hive section for this service
How to fix it — step by step
- Reinstall the manufacturer's driver
Uninstall the device in Device Manager (tick 'Attempt to remove the driver'), restart, and install the manufacturer's current package for your exact model. The installer rewrites the service key.
- Undo registry cleaning if it just happened
If a registry cleaner ran just before Code 40 appeared, use its built-in restore (or System Restore) to roll back the cleaning, then reinstall the driver.
If the code comes back after these steps, treat it as a hardware or service fault rather than a settings problem — that is the honest end of software troubleshooting for this code.
Is it a driver problem?
Yes. Yes — the missing information is the driver's own service registration. Reinstalling the manufacturer's driver recreates the service key with correct values, which is why reinstall is the whole fix.
Get the official driver or support for your device
If a fix above points you at a driver, get it from the manufacturer only:
Microsoft Support — Update drivers manually in Windows Opens support.microsoft.com
Printer, laptop or PC drivers by brand: HP · Dell · Lenovo · Acer · ASUS · Canon · Epson · Brother · Samsung printers
Related errors
- Code 19 — Windows cannot start this device because its registry configuration information is incomplete or damaged.
- Code 32 — A driver (service) for this device has been disabled — the driver exists, but Windows has been told not to start it.
- Code 39 — Windows cannot load the device driver for this hardware — the driver file is corrupted or missing.
Verified 2026-11-28 against: support.microsoft.com · www.pugetsystems.com. Meanings follow the manufacturers' and Microsoft's published documentation; where a code's meaning depends on the exact model, the page says so.