How to Fix classpnp.sys BSOD Error in Windows?

When using a computer (specifically when plugging in a peripheral), users may encounter the Blue Screen of Death (BSOD) with the error code ‘SYSTEM SERVICE EXCEPTION‘. This happens when the ‘classpnp.sys‘ file fails. The classpnp.sys file is an essential system file, managing plug-and-play hardware devices connected to the computer.

This error is caused when an unsupported device is connected to the computer, resulting in problems with the classpnp.sys file and, consequently, BSOD.

Other reasons could involve corrupted drivers, problems with system files, or hardware incompatibilities.

This article covers how to resolve this issue.

Before doing anything, you need to boot into Safe Boot, as Windows crashes as soon as you boot into Windows, triggering the classpnp.sys and resulting in BSOD. 

Restarting the computer a few (3-5) times will load it into Advance Startup, from where you can safe boot Windows, Once you are loaded into Advanced startup, follow these steps:

  1. Click on Troubleshoot.
  2. Select Advanced options.
  3. Click on Startup settings.
  4. Press F4 key to boot into Safe Mode.

Once safe mode is loaded in, follow the methods shown below:

1. Run SFC and DISM

SFC (System File Checker) scans and repairs corrupted system files, while DISM (Deployment Image Servicing and Management) checks that the Windows image is correct.

  1. Open the Search menu, type cmd, and then launch the Command Prompt as an Administrator.
  2. Enter the following commands:
    sfc /scannow
    Dism /Online /Cleanup-Image /RestoreHealth

  3. Once the scans are done, restart your computer.

2. Update Drivers

Updating drivers to their latest version ensures your device runs with up-to-date drivers, potentially solving the issue.

  1. Click on the Search bar, type Device Manager and open it.
  2. Right-click on every piece of hardware, and select Update Driver.

Third-party tools can also be used to update drivers. For more details, see Best Driver Updater.

3. Remove 3rd Party Antivirus

Third-party antivirus software can create conflicts with the drivers, resulting in this error. It’s advisable to uninstall any third-party antivirus and use Windows Defender instead.

4. Check for Faulty Hardware

Faulty hardware is the main trigger of this error. So, disconnecting any recently plugged-in devices that might be causing the issue is recommended. This will stop the file from triggering, which can fix this problem.

5. Rename the classpnp.sys File

When a system file, such as classpnp.sys, acts faulty, one troubleshooting step can be to rename it. This action forces Windows to replace the problematic file with a new, error-free version.

Restart the computer a few (3-5) times to load Advanced Startup as you cannot access Windows, Advanced Startup will allow you to access Command Prompt.

  1. Choose Troubleshoot in the Advanced Startup page.
  2. Select Advanced options.
  3. Choose Command Prompt and follow any instructions that appear.
  4. Issue this command:
    rename c:\windows\system32\drivers\classpnp.sys classpnp.old

  5. Start Windows as normal.

6. Reinstall Windows

If none of the above resolutions work, resetting Windows might be the best option. This action deletes all files that may be causing issues, and installs a fresh, clean version of Windows without any third-party software.

For more detailed steps, see our guide on How to Reset Windows.


Muhammad Zubyan

Muhammad Zubyan is a certified Google IT Support Professional with over 7 years of extensive experience. He has worked on more than 1500 computers, gaining valuable insights that enable him to detect and troubleshoot any complicated root cause of Windows-related issues and errors. In addition to managing Appuals as a Senior Editor, he is currently developing his own Game Optimization program that caters to both gamers and casual users alike.