More information if it can help, when I look in my registry under:

"HKCU\Software\Microsoft\Windows NT\CurrentVersion\Devices"

I see this key for my printer with the wrong share name:

\\server\HP LaserJet P4014/P4015 PCL6

the value on that key is: winspool,Ne03:

under "HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows","Device"

the key has this value: \\server\HP LaserJet P4014/P4015 PCL6,winspool,Ne03:

since it's a network printer on the current user it's not listed under

"HKLM\System\CurrentControlSet\control\Print\Printers"


Edit: forgot to mention in my first post that the printer gets deleted from the code with the share name not the printer name.


Edit 2: the printer gets deleted from both code depending on wich one I put first in the script.


Edited by cividan (2011-11-22 10:32 PM)