NS_E_WMP_AUTOPLAY_INVALID_STATE (0XC00D12FC) Fix
This error hits when Windows Media Player or AutoPlay tries to run a device that's in a bad state. Usually after connecting a phone, USB drive, or CD that didn't finish mounting properly.
You plug in a USB drive, insert a CD, or connect your phone, and instead of the AutoPlay dialog popping up, you get the NS_E_WMP_AUTOPLAY_INVALID_STATE error with code 0XC00D12FC. The message reads: "The state is not valid for this request." This usually happens after a device was disconnected improperly — like yanking a USB drive without safely ejecting it, or a CD that was still spinning when you opened the tray. Sometimes it's a registry hiccup after a Windows update.
What causes this?
The culprit here is almost always Windows Media Player or the AutoPlay service holding onto a stale device state. When you yank a device while it's still being read, the system doesn't clean up the internal state machine. Next time you connect something, the service trips over itself and throws this error. Another common trigger: the ShellHWDetection service crashed and didn't restart properly.
Don't bother reinstalling Windows Media Player — that rarely helps. The real fix is resetting the state by either restarting the relevant service or clearing a registry key.
Fix 1: Restart the Shell Hardware Detection Service
- Press Win + R, type
services.msc, hit Enter. - Scroll down to Shell Hardware Detection.
- Right-click it, select Restart. If it's stopped, right-click and Start it.
- Set it to Automatic if it isn't already (right-click > Properties > Startup type).
- Close Services, reconnect your device, and test AutoPlay again.
This fixes maybe 60% of cases. If it didn't work, move to the next fix.
Fix 2: Clear the AutoPlay Registry Key
This one's more direct. Windows stores AutoPlay history in the registry. If that data is corrupted or stale, you get the invalid state error.
- Press Win + R, type
regedit, hit Enter. - Navigate to:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers - Look for a subkey called EventHandlers. Delete it (right-click > Delete).
- Also check and delete KnownEventHandlers if it exists.
- Close Regedit and restart your PC.
After reboot, Windows rebuilds those keys fresh. This clears any bad state data.
Fix 3: Run the AutoPlay Troubleshooter
Windows 10 and 11 have a built-in troubleshooter for this. It's not magic, but it can reset things you might miss.
- Go to Settings > System > Troubleshoot > Other troubleshooters (or Additional troubleshooters on older builds).
- Find Hardware and Devices. Run it.
- If that doesn't show up, run this command in an admin Command Prompt:
msdt.exe -id DeviceDiagnostic - Follow the prompts. It might ask to restart.
Fix 4: Reset Windows Media Player
If the error specifically shows up when WMP tries to autoplay (like for a CD or DVD), reset its settings.
- Open Windows Media Player.
- Press Alt to show the menu bar, go to Tools > Options.
- Go to the Devices tab.
- Select the device type (CD/DVD) and click Advanced.
- Click Reset to restore defaults.
- Apply, OK, close WMP.
What if it still fails?
If none of the above worked, check these:
- Test with a different device — a different USB stick or CD. If that works, the original device is the problem, not Windows.
- Check for pending Windows updates. A botched update can mess with shell extensions. Run
wuauclt /detectnowfrom an admin prompt, or just check Settings > Windows Update. - Run SFC and DISM. Corrupt system files can cause this. Open admin Command Prompt and run:
sfc /scannow DISM /Online /Cleanup-Image /RestoreHealth - Create a new user profile — if the error only appears on your account, the profile's shell state is toast. Test by making a temporary admin account and seeing if AutoPlay works there.
- Disable and re-enable AutoPlay in Group Policy (Pro/Enterprise only). Run
gpedit.msc, go to Computer Configuration > Administrative Templates > Windows Components > AutoPlay Policies, set Turn off AutoPlay to Enabled, then back to Not Configured.
I've seen this error maybe twenty times over the years. Fix 2 (registry clear) is the one that works most often. Start there if the service restart didn't do it. And for the love of all that's holy, always safely eject USB drives. Saves you from this exact headache.
Was this solution helpful?