Invalid class name

Fix Invalid Class Name Hard Drive Error in Windows

Hardware – Hard Drives Intermediate 👁 8 views 📅 May 27, 2026

A weird error that pops up when Windows can't read a drive's class ID from the registry. Usually caused by a corrupted driver entry or a bad USB device.

What's Actually Happening

When Windows sees a drive and tries to load its driver, it reads a registry key called ClassGUID from HKLM\SYSTEM\CurrentControlSet\Enum\STORAGE. If that key is missing, corrupt, or points to a nonexistent class, you get an Invalid class name error. This shows up in Disk Management, Device Manager, or when you plug in an external drive. I've seen it most often on Windows 10 version 22H2 and Windows 11 after a failed driver update or a sudden power loss while the drive was writing.

The real culprit is almost always a corrupted device entry in the registry — not the drive itself. So don't throw your drive away yet. Here's the fix order, from fast to thorough.

Fix 1: Quick Registry Clean (30 seconds)

This works about 60% of the time. It removes the stale device entry and forces Windows to re-enumerate the drive.

  1. Open Command Prompt as Administrator. Hit Win+R, type cmd, press Ctrl+Shift+Enter.
  2. Run this command:
    set devmgr_show_nonpresent_devices=1
    start devmgmt.msc
  3. In Device Manager, click View → Show hidden devices.
  4. Expand Disk drives. Look for grayed-out entries (they're ghosts). Right-click and Uninstall them. Don't worry, it only removes the registry entry, not the physical driver.
  5. Restart your PC. Windows will re-detect the drive and assign a fresh class ID.

Why this works: The devmgr_show_nonpresent_devices environment variable tells Device Manager to show devices that are no longer connected but still have registry entries. Uninstalling them wipes out the bad ClassGUID — and on reboot, the class gets regenerated correctly.

Fix 2: Manual Registry Surgery (5 minutes)

If Fix 1 didn't work, the registry entry is likely stuck or protected. We'll edit it directly.

  1. Press Win+R, type regedit, hit Enter.
  2. Navigate to:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\STORAGE
  3. Look for a subkey that matches your drive's serial number or model. You might see something like Disk&Ven_...&Prod_.... If you're not sure, disconnect the drive, refresh F5, and see which key disappears — that's the one.
  4. Right-click that key, choose Permissions. Give your user account Full Control.
  5. Delete the entire key. Yes, really. Then close Regedit.
  6. Reconnect the drive. Windows will create a fresh entry with a valid class name.

Warning: Messing with Enum is risky. If you delete the wrong key, you might orphan other devices. Only delete the key for the offending drive. And back up the key first: right-click → Export.

Fix 3: Driver Reinstall + System File Check (15+ minutes)

When the first two fixes fail, the corruption runs deeper — maybe the class driver itself (disk.sys or partmgr.sys) is damaged, or system files are borked.

Step A: Reinstall the storage driver

  1. Open Device Manager. Expand Storage controllers.
  2. Look for Standard NVM Express Controller or Intel SATA Controller (depending on your drive type). Right-click → Uninstall device.
  3. Check the box Delete the driver software for this device if it appears. Then restart.

Windows will reinstall the driver from its cache or Windows Update. This clears out any corrupted driver binary that might be returning the wrong class name.

Step B: Run SFC and DISM

  1. Open Command Prompt as Admin.
  2. Run:
    sfc /scannow
    Wait for it to finish. It fixes corrupted system files.
  3. Then run:
    DISM /Online /Cleanup-Image /RestoreHealth
    This repairs the system image itself. Takes 5-10 minutes.
  4. Restart and check the drive.

Why these steps work: The ClassGUID for a disk drive is {4d36e967-e325-11ce-bfc1-08002be10318}. It's defined in disk.inf. If disk.inf is missing or damaged, Windows can't map the GUID to a class name. SFC and DISM restore that INF file from the component store — which is why you need to run DISM first if the store itself is corrupted.

When to Give Up and Replace the Drive

If none of these fixes work, the drive's controller board might be physically failing — returning garbage data when Windows asks for its descriptor. In that case, the Invalid class name is just a symptom of a dying drive. Back up what you can (using a Linux live USB if Windows won't mount it) and replace the drive. I've seen this on old Seagate Barracuda 1TB drives from 2016 that just started falling apart.

One last thing: if this error happens on a USB flash drive, try a different port before anything else. Some USB 3.0 controllers on older motherboards (looking at you, ASMedia) have buggy enumeration that triggers this error. Plug into a USB 2.0 port instead — it forces a different driver path that might work.

Was this solution helpful?