Case: HP Deskjet 2520hc, shared from a PC/server, client on Windows 10 x64.
Root Cause
If you connect to a network printer by opening Explorer → typing \\server-name → double-clicking the printer, Windows auto-installs a driver for you — and it often ends up with a mismatched/generic minidriver running on top of Windows’ built-in Unidrv printing architecture (you can check this under C:\Windows\System32\spool\drivers\x64\3), instead of the vendor’s actual tuned driver package. That mismatch is what triggers:
Operation failed with error 0x00000006Unable to install printer. The handle is invalid
(Note: Unidrv itself is a legitimate Microsoft component that many real HP drivers are built on too — it’s the wrong minidriver getting auto-assigned that causes the failure, not Unidrv being broken.)
Full Cleanup First (Recommended)
Before reinstalling manually, wipe out any leftover trace of the botched auto-install — otherwise you’ll keep hitting stale ports/drivers:
- Print Management (
printmanagement.msc, under Administrative Tools) → Print Servers → [your PC] → Drivers → find the printer’s driver → delete it. Check Ports too and remove any stale\\server-name\printer-nameentries. - Devices and Printers → right-click the printer → Remove device.
- Add or Remove Programs (Apps & Features) → uninstall any HP software package tied to this printer, if one got installed.
- Stop the Print Spooler service (
services.msc) → clear outC:\Windows\System32\spool\drivers\x64\3(and\4if present) andC:\Windows\System32\spool\PRINTERS→ start the Print Spooler service again.
A reboot after this is a good idea before moving on.
The Fix
Skip the Explorer auto-install. Install manually via Add Printer instead:
- Add Printer → Add a local printer (not “network printer”).
- Create a new port → type Local Port → enter
\\server-name\printer-name.- If you get “port already exists” → pick Use an existing port and select the same port from the dropdown instead of creating a new one.
- Download the official driver from HP (the Basic Driver package, not the Full Feature Software) → extract it using winrar/winzip (don’t run the installer directly).
- In the wizard, click Have Disk → browse to the entire extracted folder (the
.infneeds its companion DLL/CAT files sitting in the same folder). - Pick the printer model that shows up from that inf file → finish the wizard.