How to fix USB error Code 38: a previous instance of the device driver is still in memory

Prefer to fix it yourself? The manual steps follow.

  • 7methods
  • 2 to 30 minutes
  • Easy
Start fixing

Applies to Windows 11 and Windows 10 PCs where a USB flash drive, external disk, USB controller or other device shows Code 38 in Device Manager

7 methods in this guide
  1. What Code 38 means
  2. Causes, ranked
  3. Check the device
  4. The fixes
  5. 1. Restart the PC
  6. 2. Full shutdown
  7. 3. Turn off Fast Startup
  8. 4. Reinstall USB devices
  9. 5. Remove duplicate software
  10. 6. Update or roll back
  11. 7. Clean boot test
  12. Still not fixed
  13. Prevent it
  14. FAQ
Question

Hello. When I tried to load onto my USB, I received this message: "Windows cannot load the device driver for this hardware because a previous instance of the device driver is still in memory. (Code 38)" Can I fix it?

Code 38 means Windows tried to load a device's driver while an earlier copy of the same driver was still in memory, so the USB drive or other device does not work. Microsoft's fix is a restart. Use Restart, not Shut down, because Fast Startup can keep the stuck driver.

Short answer

Code 38 means the device's driver could not start because an older instance of it never unloaded. Microsoft's recommended resolution is to restart the computer. Choose Restart from the Start menu, not Shut down, because Fast Startup saves loaded drivers and brings them back (Fix 1). If Code 38 returns, do a full shutdown with the USB device unplugged (Fix 2), then reinstall the device and its USB controllers (Fix 4).

At a glance
ErrorWindows cannot load the device driver for this hardware because a previous instance of the device driver is still in memory. (Code 38). Microsoft's internal name is CM_PROB_DRIVER_FAILED_PRIOR_UNLOAD.
Where it appearsIn Device Manager, in the Device status box of the device's Properties. The device has a yellow warning sign and does not appear or open in File Explorer.
Main causeAn earlier copy of the driver did not unload: a wrong reference count, a race between load and unload, or two driver packages that install the same service.
Fastest fixStart > Power > Restart (Fix 1). Microsoft gives a restart as the only resolution.
Also written ascode 38, error code 38, error 38, windows code 38, code 38 windows 10, The driver could not be loaded because a previous version of the driver is still in memory, CM_PROB_DRIVER_FAILED_PRIOR_UNLOAD.
AffectsAny device with a driver, most often USB flash drives, external disks, card readers and USB controllers. Windows 11 and Windows 10.
Vendor statusMicrosoft documents Code 38 and recommends a restart. No Microsoft known issue tied to it was listed on 15 October 2026.
Why Shut down may not helpWith Fast Startup on, Shut down saves the kernel and its loaded drivers to Hiberfil.sys, so the stuck copy can come back.
Time to fix2 minutes for a restart. 15 to 30 minutes when the driver or its software must be reinstalled.

Facts checked on 15 October 2026. Steps written for Windows 11 (25H2 and 26H2) and Windows 10 22H2.

What "a previous instance of the device driver is still in memory (Code 38)" means

Code 38 is a Device Manager problem code. Microsoft's driver documentation names it CM_PROB_DRIVER_FAILED_PRIOR_UNLOAD and says the driver could not be loaded because a previous instance is still loaded. Windows wanted to start the driver for your device, found an older copy of it that never shut down, and gave up.

The driver file itself is usually fine. That makes Code 38 different from Code 39, where the driver is damaged or missing. Here the problem is timing and memory, which is why a clean start of Windows clears it in most cases.

The spellings people search for, and what each one means
What you see or typeWhat it means
Windows cannot load the device driver for this hardware because a previous instance of the device driver is still in memory. (Code 38)The full English message in the device's Device status box
The driver could not be loaded because a previous version of the driver is still in memory.The cause line Microsoft prints under the same code
code 38, error code 38, error 38, windows code 38, error38Short searches for the same Device Manager code
CM_PROB_DRIVER_FAILED_PRIOR_UNLOADThe code's name in Microsoft's documentation and in PowerShell output
motherboard code 38, ge washer code 38, 0x38Different things with the same number: see the FAQ
Your files on the USB drive are safe

Code 38 stops Windows from talking to the drive. It does not erase anything on it. Do not format the drive to fix this code: once the driver loads, the files are there again.

Why the old driver stays in memory: the causes, most common first

Microsoft names three technical reasons. The driver keeps a wrong count of who is still using it, so Windows never unloads it. Loading and unloading run into each other in a race. Or the same driver is named by several AddService lines in one or more INF files, which happens when two packages install the same driver service.

Diagram comparing Shut down with Fast Startup, which saves loaded drivers to Hiberfil.sys, with Restart, which starts Windows fully and clears Code 38
Shut down with Fast Startup keeps the loaded drivers, so only Restart or a full shutdown reliably clears Code 38.
Causes ranked by how often they explain Code 38, each with its fix
How oftenCauseSignFix
Most oftenA driver instance that did not unload after the device was removed or Windows sleptCode 38 on one device, often after unplugging a USB drive without ejecting itFix 1
OftenFast Startup brings the stuck instance back after every Shut downCode 38 is gone after Restart but returns the next dayFix 2, Fix 3
OftenThe USB controller or root hub driver is stuck, not the deviceSeveral USB devices fail on the same portsFix 4
Less oftenTwo driver packages for the same device, such as an old maker's tool next to the Windows driverCode 38 began after you installed software for the deviceFix 5
Less oftenA driver bug in load and unload that a newer or older version fixesCode 38 began after a driver update and returns after every restartFix 6
RarelyAnother program keeps the driver busyCode 38 only appears while a backup, encryption or virtual drive tool runsFix 7

Confirm it is Code 38 and find the device

One minute of checking tells you which device has the problem and whether it is one device or several. Right-click Start and select Terminal (Admin).

  1. List the devices that have a problem and their problem code:
    Get-PnpDevice | Where-Object Status -ne 'OK' | Format-Table FriendlyName, Class, Problem, InstanceId
  2. Look for CM_PROB_DRIVER_FAILED_PRIOR_UNLOAD in the Problem column. Note the device name.
  3. One row points to Fixes 1 to 3. Several USB rows at once point to Fix 4.
  4. In Device Manager, right-click the device, select Properties and read the Device status box on the General tab.
Note what happened just before

Write down whether the PC woke from sleep, whether the USB drive was pulled out without ejecting it, or whether you installed device software. The fixes below are chosen by exactly these clues.

How to fix Code 38 in Device Manager

Fix 1 is Microsoft's own resolution and clears Code 38 for most readers. The order of the rest follows how often each cause appears. Each fix says what to try next.

What you see or haveStart withThen
Code 38 on one device, first timeFix 1Fix 2
Restart helped, but Code 38 is back after the next Shut downFix 3Fix 4
Several USB devices or ports fail at onceFix 4Fix 6
It began after you installed the device maker's softwareFix 5Fix 6
It began after a driver update and returns after every restartFix 6Fix 7
It appears only while a backup or virtual drive tool runsFix 7Fix 5

Fix 1. Restart Windows with Restart, not Shut down

2 minutesLow riskYou see Code 38 for the first time, on any device.

Microsoft's only recommended resolution for Code 38 is to restart the computer. A restart starts Windows fully, so every driver is loaded fresh and the old instance that never unloaded is gone.

  1. Save your work and close open files on the USB drive.
  2. Select Start, then the Power button, then Restart.
  3. Sign in and plug the USB device in again if you unplugged it.
  4. Open Device Manager, right-click the device, select Properties and read Device status.
Why not Shut down

Microsoft explains that with Fast Startup, Shut down saves the kernel memory image, including the loaded kernel-mode drivers, to Hiberfil.sys. The next power on loads that image, so the stuck driver can come back with it. Restart does not use Fast Startup.

It worked if: The yellow sign is gone, Device status reads This device is working properly and the USB drive opens in File Explorer.

If not: If Code 38 is still there after a restart, go to Fix 2 and do a full shutdown with the device unplugged.

Fix 2. Do a full shutdown with the USB device unplugged

5 minutesLow riskRestart did not clear Code 38, or the PC was asleep or hibernated when the problem began.

A full shutdown closes the kernel and every driver, which Fast Startup skips. Unplugging the device and waiting also lets the USB port power down, so no part of the old session is left when Windows finds the device again.

  1. If you can, eject the USB drive in File Explorer, then unplug it.
  2. Press and hold Shift, then select Start > Power > Shut down. Keep holding Shift until the screen goes dark.
  3. Or open Terminal and run a full shutdown, which skips Fast Startup:
    shutdown /s /t 0
  4. Wait about 30 seconds, then turn the PC on.
  5. Sign in and plug the device into the same port, then check Device status again.
Windows Start menu with the power options open, showing Sleep, Shut down and Restart, used for a full shutdown to clear Code 38
Hold Shift while you select Shut down to close Windows fully; shown on Windows 10, the Power menu works the same on Windows 11.

It worked if: The device works after the cold start and Device status reads This device is working properly.

If not: If it worked but Code 38 returns after a normal Shut down later, go to Fix 3. If it never cleared, go to Fix 4.

Fix 3. Turn off Fast Startup if Code 38 keeps coming back

3 minutesLow riskRestart or a full shutdown clears Code 38, but it is back after a normal Shut down.

With Fast Startup on, every Shut down saves the loaded drivers and reloads them, so a driver that fails to unload carries its stuck state into the next session. Turning it off makes every shutdown a full one.

  1. Press Win + R, type powercfg.cpl and select OK.
  2. Select Choose what the power buttons do, then Change settings that are currently unavailable.
  3. Clear Turn on fast startup (recommended) and select Save changes.
  4. Shut down the PC and start it again. Step by step: Turn off Fast Startup
Shutdown settings with Turn on fast startup (recommended): screenshot taken on Windows 11 26H2
Clear Turn on fast startup (recommended) so that Shut down no longer brings back the driver behind Code 38.

The cost is a slower start, usually a few seconds on a PC with an SSD. You can turn Fast Startup back on later, once the driver is fixed with Fix 5 or Fix 6.

It worked if: After a normal Shut down and power on, the device works and Code 38 does not return.

If not: If Code 38 returns even after a full start, the driver itself fails to unload: go to Fix 4.

Fix 4. Reinstall the device and the USB controllers

10 minutesLow riskCode 38 stays after a restart, or several USB devices or ports fail at once.

Removing the device and its USB host controller or root hub from Device Manager unloads their driver instances. After a restart Windows builds them again from scratch, which clears a stuck instance in the controller as well as in the device.

Mouse and keyboard may stop for a moment

If your mouse and keyboard are USB, they stop working when you uninstall the USB controllers, until the restart in step 6. Do steps 4 and 5 last, or use the keyboard and Alt + F4 to restart.

  1. Plug in the USB device with Code 38, right-click Start and select Device Manager.
  2. Right-click the device with the yellow sign, select Uninstall device, tick Attempt to remove the driver for this device if it is shown, and select Uninstall.
  3. Expand Universal Serial Bus controllers.
  4. Right-click any USB Root Hub with a yellow sign and select Uninstall device.
  5. Right-click each Host Controller entry and select Uninstall device.
  6. Restart the PC with the USB device still plugged in. Windows reinstalls the controllers and the device by itself.
Device Manager with Universal Serial Bus controllers expanded, listing USB eXtensible Host Controllers, USB Composite Devices and USB Root Hub entries
The host controllers and root hubs under Universal Serial Bus controllers are the entries to uninstall; Windows 10 screen, the same list on Windows 11.

All driver buttons with screenshots: Update, roll back or reinstall a driver

It worked if: After the restart the controllers and the device appear again without a yellow sign, and the USB drive shows up in File Explorer.

If not: If Code 38 comes back on the same device, check its software with Fix 5.

Fix 5. Remove the extra driver software that installs the same driver

15 minutesLow riskCode 38 began after you installed the device maker's tool, an old driver pack or a second version of the same software.

Microsoft says Code 38 can appear when one driver is named by several AddService directives in one or more INF files. In practice that means two packages that set up the same driver service, so Windows sees an instance that is already there.

  1. Open Settings > Apps > Installed apps (on Windows 10, Settings > Apps > Apps & features).
  2. Look for two entries for the same device, such as an old and a new version of a card reader, docking station, phone sync or USB tool. Note the maker's name.
  3. Uninstall the older entry, or both if you are not sure which one is current.
  4. In Device Manager, uninstall the device with Attempt to remove the driver for this device ticked, as in Fix 4, step 2.
  5. Restart the PC.
  6. If the device needs the maker's software, install one current version from the maker's own site, then restart again.
Uninstall Device dialog with the remove driver checkbox: screenshot taken on Windows 11 26H2
Uninstall Device with the driver removal box ticked removes the duplicate driver package so only one copy is installed again.

It worked if: Only one copy of the device's software is installed, and the device works after the restart.

If not: If the device has no extra software, or Code 38 still returns, go to Fix 6.

Fix 6. Update or roll back the device driver

10 minutesLow riskCode 38 returns after every restart, or it began right after a driver update.

A wrong reference count or a race between load and unload is a fault in the driver code itself. A newer version from the maker may fix that fault, and rolling back returns to a version that unloaded correctly.

  1. In Device Manager, right-click the device with Code 38 and select Properties.
  2. Open the Driver tab and note the Driver Provider, Driver Date and Driver Version.
  3. If Code 38 began after a driver update, select Roll Back Driver, choose a reason and select Yes.
  4. Otherwise check Settings > Windows Update > Advanced options > Optional updates for a newer driver of that device.
  5. Or download the latest driver for your PC, motherboard or device model from the maker's site and install it.
  6. Restart the PC and check Device status.
Driver tab with Update Driver, Roll Back Driver and Uninstall Device: screenshot taken on Windows 11 26H2
The Driver tab shows the version that fails with Code 38 and holds the Update Driver and Roll Back Driver buttons.

For USB controllers on a desktop PC, the chipset or USB driver comes from the motherboard maker. On a laptop it comes from the laptop maker's support page. Avoid third-party driver updater programs.

It worked if: The Driver Version has changed and the device works after the restart.

If not: If the version is the newest one and rolling back is greyed out, go to Fix 7.

Fix 7. Find a program that keeps the driver busy with a clean boot

20 minutesLow riskCode 38 appears only at times, for example while a backup, disk encryption, antivirus scan or virtual drive tool runs.

A driver unloads only when nothing holds it any more. A program that keeps a USB drive or its driver open can stop that, and a clean boot starts Windows without such programs so you can see whether one of them is the cause.

A clean boot turns off non-Microsoft services and startup apps for one test. If Code 38 does not appear in a clean boot, turn the services back on in halves until it returns, and you have found the program. Step by step: How to perform a clean boot in Windows

  1. Press Win + R, type msconfig and select OK.
  2. On the Services tab, tick Hide all Microsoft services and select Disable all.
  3. Restart the PC and plug in the device.
  4. If Code 38 is gone, turn the services back on in halves and restart each time until it returns.
  • Programs that often keep USB drives open: backup and sync tools, disk encryption, virtual drive and ISO tools, device maker utilities.
  • Update or remove the program you find, then return Windows to a normal start as the procedure explains.
  • Never leave security software turned off: update it or ask its maker instead.

It worked if: In a clean boot the device works, and after you find and update the program it also works in a normal start.

If not: If Code 38 appears even in a clean boot, read the next section.

Still Code 38: what to check and whom to ask

If none of the fixes cleared Code 38, try the device on another PC and another device on this PC. That one test splits the problem in two: the device, or this Windows installation.

  • The device name and Problem value from the Get-PnpDevice command near the top of this page.
  • The Driver Provider, Driver Date and Driver Version from the device's Driver tab.
  • Whether Code 38 clears after Restart and returns after Shut down, or never clears.
  • Your Windows edition and version from Settings > System > About.
  • Whether the device works on another PC.
Where to askWhen
The device or PC maker's supportFirst: a load and unload fault is in their driver, and they can say whether a fixed version exists
Microsoft Support or Microsoft Q&AWhen Code 38 is on a built-in Microsoft driver, such as the standard USB host controller, after Fixes 1 to 6
When it is hardware

Code 38 is a driver code, not a hardware fault. Suspect the USB drive only if it fails on a second PC too. Suspect a USB port only if every device fails on that port and works on another one.

How to keep Code 38 from coming back

Do
  • Eject USB drives in File Explorer before you unplug them.
  • Use Restart, not Shut down, after a driver or device problem.
  • Keep one current version of each device maker's software.
  • Get drivers from the device or PC maker, or from Windows Update.
Do not
  • Unplug a USB drive while files are copying or the PC is asleep.
  • Install two tools that manage the same device.
  • Use third-party driver updater programs.
  • Format a USB drive to fix Code 38: the files are fine.

Windows 10 left support on 14 October 2025. Device makers may stop publishing drivers for it, so a fixed driver for an old device is less likely to arrive on Windows 10.

Frequently asked questions

What is error code 38 in Windows?

Code 38 is the Device Manager code for CM_PROB_DRIVER_FAILED_PRIOR_UNLOAD. Its message is "Windows cannot load the device driver for this hardware because a previous instance of the device driver is still in memory. (Code 38)". It means an older copy of the device's driver never unloaded, so Windows could not start a new one. Microsoft's recommended resolution is to restart the computer. Use Restart from the Start menu, because Shut down with Fast Startup can keep the stuck driver.

Why does Code 38 come back after I shut down my PC?

Because of Fast Startup. When it is on, Shut down closes your apps and signs you out, but saves the Windows kernel with its loaded drivers to the hibernation file, Hiberfil.sys. The next start loads that saved image, and the stuck driver with it. Restart does not use Fast Startup, so it clears the code. If you want Shut down to clear it too, turn Fast Startup off (Fix 3).

How do I fix Code 38 on a USB flash drive?

Restart Windows with Restart, not Shut down, then plug the flash drive in again (Fix 1). If the code stays, unplug the drive, do a full shutdown with Shift + Shut down and start the PC again (Fix 2). Still failing, uninstall the drive and the USB controllers in Device Manager and restart (Fix 4). The files on the flash drive are not touched by Code 38 or by these fixes.

Is Code 38 the same on Windows 10 and Windows 11?

Yes. Microsoft's Device Manager help lists the same message and the same resolution for both. The fixes on this page work on Windows 11 and Windows 10, and only the Installed apps path in Fix 5 differs slightly. Windows 10 left support on 14 October 2025, so a newer driver for an old device is less likely to be released for it. Search terms such as "code 38 windows 10" lead to this same fix.

Will I lose the files on my USB drive?

No. Code 38 only stops Windows from loading the driver that talks to the drive. The data on the drive is not changed. Uninstalling the device or the USB controllers in Device Manager does not touch the drive's files either. Do not format the drive or run repair tools that write to it because of this code. Once the driver loads, the drive appears in File Explorer with its files.

What does "error code 38 drives cannot be found" mean?

Most likely the drive is missing from File Explorer because its driver or the USB controller has Code 38. Open Device Manager and look for a yellow sign under Disk drives, Universal Serial Bus controllers or Storage controllers. If you see Code 38 there, follow Fix 1 and Fix 4. If Windows Setup says it cannot find any drives, that is a storage driver issue during installation, which this page does not cover.

What is motherboard code 38?

It is not this error. Many motherboards show a two-digit debug code on a small display or LEDs while the PC starts, and 38 is one of those codes. Its meaning is set by each motherboard maker and differs between them, so look it up in your board's manual. Windows Code 38 only appears in Device Manager after Windows has started. We could not confirm one meaning of debug code 38 that applies to all boards.

Is GE washer code 38 or error 0x38 related?

No. This page is about Code 38 in Windows Device Manager, a driver message. A code 38 on a GE washer or another appliance is that appliance's own fault code, and its manual explains it. A code written as 0x38 or 00000038 is a hexadecimal number used by other Windows parts, not this Device Manager code. We could not confirm one Windows message for 0x38 that matches searches for it.

Is Code 38 a hardware problem?

Almost never. Device Manager can see the device, and the message says the driver could not load because an older instance of it is still in memory. That is a software state, and Microsoft's fix is a restart. Suspect the hardware only when the device fails on a second PC too, or when every device fails on one USB port. Microsoft lists no hardware cause for this code.

What is the difference between Code 38 and Code 39?

Code 38 means the driver could not load because an earlier copy of it is still running in memory. Code 39 means the driver could not load because its file is damaged, missing or blocked. So Code 38 is usually cleared by a restart, while Code 39 usually needs the driver to be reinstalled or replaced. See our guide on Code 39, the driver may be corrupted or missing.

Sources

  1. Microsoft Learn: Code 38, CM_PROB_DRIVER_FAILED_PRIOR_UNLOAD (learn.microsoft.com)
  2. Microsoft Support: Error codes in Device Manager in Windows (support.microsoft.com)
  3. Microsoft Learn: Distinguishing fast startup from wake-from-hibernation (learn.microsoft.com)

Did this fix work?

One click, no account. It tells the next reader which guides are worth their time.

We show the result once 20 readers have answered.
Still broken? Describe your case with the exact error text.

Questions and experiences: fix USB error Code 38: a previous instance of the device driver is still in memory

Still broken, or found a fix we did not cover? Ask here: members and our editors answer. Reading is open; writing needs a free account.

0 comments

…

4,322 members already hereThey read, write, comment and vote. 0 verified · 31 joined this year