Archive for July, 2009

Printer Connection cannot be removed

Monday, July 13th, 2009

ScreenHunter_02 Jul. 13 15.33

Sometimes,  a rogue printer driver entry gets left behind in your printer list. Sometimes, you cant delete it.  Somtimes its even a duplicate of a printer that already exists, perhaps with a slightly different queue name.

Various message sources, like here suggest breaking network connection with the printer in question may be needed before windows “releases” the print queue so it can be deleted.

But what if the printer in question no longer exists at all? 

This seems to occur under different circumstances, but one that is often suggestion is it can happen when printer mappings are added to a user profile using scripting.

The suggested solution in this case seems to be to run the following command:

rundll32 printui.dll, PrintUIEntry /gd \\server\printername


I ran into this problem on our Citrix farm.

Here we had 2 print queues for the same printer, the top one being incorrect, but impossible to delete:


I isolated one of the servers so I could play with it without any users on it.

I made sure all scripted mappings to both the old and new queue where disabled.
I even deleted the queue on the server

 I tried first disconnecting the printer physically, then trying to delete the errant queue. This did not work.

I tried the rundll32 command, no dice either.

The next step was the more drastic one. I logged onto the desktop of the Citrix server with ILO, disabled the network card, rebooted, and low and behold, I was able to remove the queue.

But when I logged into the server again as a test user, the driver had returned. Even with our scripting turned off, the queues actually deleted  on the print server, the queue still appeared for my test user on the Citrix server.

This could only mean the entry was stuck in the user profile.

ScreenHunter_03 Jul. 13 17.44 by you.

And indeed, there it was, under HKLU\<user-sid>\Printers\Connections

I deleted the errant entry, and I never saw the queue again, at least not for that particular user!

I wonder how often this happens. I was suprised to not have come across something about the user registry hive when googling this problem.

Now I have to see what I am going to do about all the other users that have this entry. Perhaps it would be better practice to actually delete this entire set of keys when they log out, every time.

The printers get mapped by our logon system anyway when they log in again. It might help keep their printer list a little cleaner in future.