Fix: Windows Cannot Load the Device Driver (Code 38)
This error usually appears after you connect or install a hardware device, most commonly a USB device. In Device Manager, the affected device may show the message: “Windows cannot load the device driver for this hardware because a previous instance of the device driver is still in memory. (Code 38)”
In simple terms, Windows is still holding on to an older copy of the driver, so the current one cannot load properly. This usually happens because of an incomplete shutdown, a USB driver problem, power management behavior, or interference from third-party software.

Although Code 38 can affect different types of hardware, it is reported most often with USB-connected devices. That is why several methods below focus on USB controllers and related power settings.
The fixes below are arranged from the quickest to the more advanced ones.
- USB controller drivers may be corrupted, stuck, or not reloading correctly.
- Power settings may prevent storage-related devices from reinitializing properly.
- Third-party services or startup apps may interfere with the driver during startup.
- Incomplete shutdowns can leave the old driver state loaded in memory.
Solution 1: Hold Shift While Shutting Down
This is the fastest fix and should be tried first. On some systems, especially laptops with Fast Startup enabled, a normal shutdown may not fully clear the previous driver state. Shutting down while holding Shift forces a more complete shutdown, which can remove the old driver instance from memory.
- Open the Start menu.
- Hold the Shift key.
- While holding Shift, click Power > Shut down.
- Wait until the PC turns off completely, then turn it back on.
- Check whether the device still shows Code 38.
Solution 2: Uninstall the Affected Device in Device Manager
Before reinstalling USB controllers, remove the affected device itself. This allows Windows to detect it again and load a fresh driver instance, which often fixes temporary driver-state issues.
- Press Windows + R, type devmgmt.msc, and press Enter.
- Locate the device showing the Code 38 error.
- Right-click it and select Uninstall device.

- If you see an option to remove the driver software, leave it unchecked unless you specifically want to reinstall the manufacturer’s driver.
- Restart your computer.
- Reconnect the device if needed and let Windows detect it again.
- Check whether the problem is resolved.
Solution 3: Reinstall USB Devices in Device Manager
If the affected device connects through USB, reinstalling the USB controllers is one of the most effective fixes. This forces Windows to reload the USB controller stack and rebuild how USB ports are initialized. Try this early if the issue started after connecting a USB drive, adapter, dock, or other external device.
- Press Windows + R, type devmgmt.msc, and press Enter.

Running Device Manager - Expand Universal Serial Bus controllers.
- Right-click each entry in that section and select Uninstall device.
- Repeat this for all listed USB controller entries.

Uninstalling a USB device in Device Manager - Restart your computer.
- Windows will automatically reinstall the USB controllers during startup.
- Reconnect the device and check whether the error is gone.
Solution 4: Prevent the Hard Disk from Turning Off
This setting matters most if the issue affects external drives, USB storage devices, or hardware that depends on storage-related power states. When Windows powers down the disk after inactivity, some devices may fail to reload their drivers correctly when they wake up. Setting the timeout to Never can help prevent that.
- Open Control Panel and go to Power Options.
- Next to your current power plan, click Change plan settings.
- Click Change advanced power settings.

Opening Power Options in Control Panel - Expand Hard disk > Turn off hard disk after.
- Set the value to Never, or enter 0 minutes if that option is available.
- Click Apply and OK.

Setting the hard disk to never turn off - Restart your PC and check whether Code 38 still appears.
Solution 5: Run the Hardware and Devices Troubleshooter
This method is less targeted than the fixes above, but it is still worth trying because Windows may be able to detect and correct a hardware misconfiguration automatically.
- Press Windows + R, type control.exe, and press Enter.

Running Control Panel - Set View by to Category.
- Go to Hardware and Sound > Devices and Printers.
- Find the problematic device, right-click it, and choose Troubleshoot.
- If the device is not listed, right-click your PC name and try troubleshooting from there.
- Follow the on-screen instructions and apply any suggested fix.
- Check whether the error still appears.

Troubleshooting a problematic device
Solution 6: Perform a Clean Boot
Use this method if the problem started after installing software, drivers, device utilities, or security tools. A clean boot starts Windows with only essential Microsoft services, which helps determine whether a background app or service is stopping the driver from loading correctly.
- Press Windows + R, type msconfig, and press Enter.

Running MSCONFIG - In the General tab, select Selective startup.
- Clear the Load startup items checkbox.
- Open the Services tab, check Hide all Microsoft services, then click Disable all.

Disabling all non-Microsoft services from starting up - Open the Startup tab and click Open Task Manager.
- Disable all enabled startup items.

Disabling Startup Items in Task Manager - Restart your computer and check whether the problem is gone.
- If the error no longer appears, re-enable services and startup items in small groups until you identify the conflicting app or service.
- Once you find the cause, update, reinstall, disable, or remove it as needed.





