Solution:
Root Cause: Orphaned TAP-Windows driver package left behind after the VPN client was removed TAP-Windows (service name tap0901) is a virtual NDIS 6 miniport that many VPN clients install as a shared component. If the client uninstaller removes its program files but leaves the device node, the driver package in the DriverStore or the service entry, the Plug and Play manager cannot finish the class configuration for the device. Windows then reports Code 56, 'Windows is still setting up the class configuration for this device', and the adapter stays stuck until the orphaned pieces are removed.
Diagnostic Verification: Run Get-PnpDevice -Class Net | Where-Object FriendlyName -match 'TAP' | Format-List Status, FriendlyName, InstanceId in an elevated PowerShell and look for a Status of Error. Run pnputil /enum-drivers and look for a Provider Name such as 'TAP-Windows Provider' with Original Name oemvista.inf, and note its Published Name (for example oem42.inf). Open C:\Windows\INF\setupapi.dev.log and search for 'tap0901' to see the failed install or start entries. Step-by-Step Fix: 1 Remove the device node:
If OpenVPN is still installed, list and delete adapters with its helper tool, otherwise skip to the next step.
Copy
powershell
& 'C:\Program Files\OpenVPN\bin\tapctl.exe' list
& 'C:\Program Files\OpenVPN\bin\tapctl.exe' delete all
2 Remove leftover device nodes with pnputil:
Copy the InstanceId from the verification step and run the command below.
Copy
powershell
pnputil /remove-device 'ROOT\NET\0000'
3 Delete the driver package from the DriverStore:
Replace oem42.inf with the Published Name you noted.
Copy
powershell
pnputil /delete-driver oem42.inf /uninstall /force
4 Remove the stale service only if no adapter uses it:
Run sc query tap0901. If the service exists and no TAP adapter remains in Device Manager, run sc delete tap0901. 5 Restart fully and rescan:
Reboot, then in Device Manager choose Action > Scan for hardware changes and confirm no adapter shows Code 56.
For the exact options of the driver removal commands, see the
Microsoft pnputil command syntax reference .
Prevention & Long-Term Monitoring: Uninstall VPN clients from Settings > Apps > Installed apps and let the uninstaller finish before rebooting. Before removing a VPN, check whether other VPN apps share the TAP driver, since removing it breaks them. Run pnputil /enum-drivers after VPN removals to catch orphaned packages early.