Hard Drive Error: Invalid Class Name — 3 Fixes That Actually Work
Windows throws 'Invalid Class Name' when the drive driver or registry entry gets corrupted. Here's how to kill it fast.
1. Hidden Devices in Device Manager (The Usual Suspect)
Nine times out of ten, this error comes from a ghost device that Windows still thinks is connected. I've seen this happen when you swap out an old SATA drive for an SSD, or yank a USB drive without safely removing it. The old driver lingers like a bad smell.
Here's the fix:
- Open Device Manager (right-click Start > Device Manager).
- Click View > Show hidden devices. You'll see a bunch of grayed-out entries — those are ghost devices.
- Expand Disk drives and Storage controllers.
- Right-click any grayed-out entry and select Uninstall device. Do this for every grayed-out drive and controller you see. Yes, even if you think it's harmless.
- Reboot.
Had a client last month whose print queue died because of this same trick on a printer driver, but for drives it's the #1 culprit. After reboot, Windows redetects the hardware fresh and the error usually disappears. If not, move to cause #2.
2. Registry Corruption (The Nasty One)
Sometimes the hidden device trick isn't enough because the registry itself has a bad entry under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Disk\Enum. That's where Windows stores the class GUID for each disk. Corrupt that, and you get 'Invalid Class Name'.
I've only seen this twice in 15 years — once on a Dell OptiPlex 7050 after a failed Windows update, and once on a custom build with a misbehaving NVMe drive. But when it hits, it's stubborn.
Fix it:
- Open Regedit as Administrator.
- Go to
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Disk\Enum. - Look for subkeys named
0,1,2, etc. Each one represents a disk. - Click each subkey. In the right pane, check ClassGUID. It should be
{4d36e967-e325-11ce-bfc1-08002be10318}for standard hard drives. If it's blank or garbage, delete the subkey (export it first if you're nervous). - Repeat for
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\partmgr\Enum— same idea. - Reboot.
Warning: Messing with the registry can brick your system if you delete the wrong key. Only touch the Enum subkeys, not the parent service entries. If you're not comfortable, skip to fix #3 first.
3. Reinstall the Storage Controller Driver (Brute Force)
When all else fails, blow away the storage controller driver and let Windows reinstall it. This is the nuclear option, but it works when the driver stack itself is corrupted.
- Open Device Manager again.
- Expand Storage controllers.
- Look for entries like Intel(R) Chipset SATA/PCIe RST Premium Controller or Standard NVM Express Controller for NVMe drives.
- Right-click and select Uninstall device. Check the box that says 'Delete the driver software for this device' — that's important.
- Reboot immediately. Windows will install the generic driver during boot.
If you have an NVMe drive, you might need to download the driver from your motherboard manufacturer's site first, because the generic driver sometimes doesn't support all features. I've had that issue on ASUS Z490 boards. Download the Intel RST driver or the AMD chipset driver before uninstalling, then install it manually after reboot.
This fix also clears any corrupted device class references that survived the registry edit.
Quick-Reference Summary Table
| Cause | Fix | Time | Risk |
|---|---|---|---|
| Ghost devices from old drives | Show hidden devices in Device Manager, uninstall grayed-out entries | 5 minutes | Low |
| Corrupt registry in Disk or partmgr Enum keys | Edit registry: delete bad ClassGUID subkeys | 10 minutes | Medium |
| Corrupted storage controller driver | Uninstall storage controller with driver deletion | 10 minutes | Low-Medium |
Try them in order. I've never had to go past fix #3. If the error still shows after all three, you're looking at a hardware failure — check the drive with CrystalDiskInfo or replace the cable. But 99% of the time, one of these gets your drive back online.
Was this solution helpful?