How to delete non-existing printers in Windows?

17,441

To delete a network printer through the command-line and without GUI, is possible through updating the registry.

The following two registry keys contain installed printer definitions :

HKEY_CURRENT_USER\Printers\Connections
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Providers\LanMan Print Services\Servers\Printers

You need to find the names of the sub-keys of the above that contain the network printers you wish to delete. Once you know their names, this also becomes a method for checking if a certain printer is currently installed. Delete the sub-keys, then reboot to verify that the printer stays deleted.

There are certain important points here :

  1. The Print Spooler service may need to be stopped.
  2. The printer queue must be empty, found at the folder C:\Windows\System32\spool\PRINTERS\. You can't remove a printer if you have items in the print queue. See also the article How to Forcefully Clear the Print Queue in Windows.
  3. The GUI way to delete a printer is by running as Administrator printui /s /t2, select the printer, click Remove button, check "Remove driver and driver package" and click OK.

Some more details can be found in the article Fix for Cannot Remove or Delete Network Printer in Windows.

Share:
17,441

Related videos on Youtube

Hagen von Eitzen
Author by

Hagen von Eitzen

Updated on September 18, 2022

Comments

  • Hagen von Eitzen
    Hagen von Eitzen almost 2 years

    A few network printers have been removed from the print server and I wish to automatically remove them by a script (e.g. using objPrinter.delete_ in vbs) from any client still referencing them; preferably, I would like to really know which printers I'm deleting in those cases and automatically connect an appropriate replacement printer. This would not be difficult if I could read the list of such defunct printers in the first place.

    The situation in the GUI is that the printers still show up under "Devices and printers" with the printer symbol showing only the default printer icon,being greyed out, and a yellow warning triangle shown next to it. But the printer does not get listed e.g. by the WMI query "SELECT * FROM Win32_Printer". Is there any other query that would succeed for this?

    • David
      David over 8 years
      Do you know the name of the printers? Are you also looking to remove the printer driver inf/dll files along with the printer connection? I have done the reverse of this, adding printers with vbs.
    • Hagen von Eitzen
      Hagen von Eitzen over 8 years
      @David There are many of these printers but I might be able to compile a list (even a list like "if they formerly had this printer, they better get that printer"). A full cleanup may not be required. Adding printers (say, based on office floors) is of course a fine and I've done that as well, but the current task is about printers the users might have added over the years because sometimes they need a printer somewhere else, for example. I also already managed to do an "if this old printer then that new printer" replacement skript that worked if the old ones still existed - but here they don't
    • Scorpion99
      Scorpion99 over 8 years
      Did you try to remove them from Print Management?