Error Deleting Printer
I ran into this one recently at work when we moved everyone to our new print server. We had already pushed out the new printers. I had a VB script run everytime someone logged in that logged each printer they had installed that was on the old printer server & then remove those printers. I noticed after a while that there were a few users who kept logging a printer on the old print server even though the script should have removed it the day before. It wasn’t the same printer for each user & a couple of the printers had not existed in a long time.
So I hop on with one of the users & browse to their printers. I right click on the printer & select delete. I get an error that says, “Printer connection cannot be removed. Operation could not be completed.” The fix…open regedit. Browse to HKU\SID\Printers\Connections. Delete the key for the incorrect printer.
That fixed all but two people. They still had a printer showing up in my script. Doing a search of the registry for the offending printer revealed a few other places to look; HKU\SID\Network\lpt1, HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Providers\LanMan Print Services\Servers\ServerName, & HKU\Printers\Settings. Just delete any stale entries. Now they no longer show up in my script.