Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've tried removing several network printers via rundll32 printui.dll, PrintUIEntry /dn /dd /q /n \\SERVER\PRINTER also tried the /dl but nada


WSHNetwork.RemovePrinterConnection "\\\Server\Printer",True,True

I've ran the scripts remotely and locally on different user profiles and the scripts appear to run without error but the printers never get removed, they're still there!

If the user right clicks on the printer they can remove it by clicking Remove Device.

Wondering if anyone else has seen this issue in Windows 7. Only thing I can think of is that it's a UAC issue..

share|improve this question
Were they added as global or local printers originally? – Colyn1337 Apr 30 '14 at 16:57

Okay, let's try this then:

1st) you'll have to stop the print spooler first:

start -> run -> cmd
type in: net stop spooler

2nd) follow this link to uninstall the printer

3rd) restart the print spooler

start -> run -> cmd
type in: net start spooler

Now, hopefully this will help your issue

share|improve this answer
Ok I'm a bit of a dork....I was running the script on the local machine instead of putting in logon scripts....d'oh! After adding the script to the logon script for the affected machines it worked great! Thanks for your help! :) – bonedog73 Aug 7 '12 at 21:20
This is the script I ended up using in logon scripts - not sure how to use this comment system everytime I hit enter it hits the save button so....(…) – bonedog73 Aug 7 '12 at 21:26

This is the one I used in the past (VBsript):

'Remove all Network printers but not local printers
Set WshNetwork = WScript.CreateObject("WScript.Network")
Set Printers = WshNetwork.EnumPrinterConnections

For i = 0 to Printers.Count - 1 Step 2

    If Left(ucase(Printers.Item(i+1)),2) = "\\" Then
        WScript.Echo Printers.Item(i+1)
        WSHNetwork.RemovePrinterConnection Printers.Item(i+1)
    End IF

Hope it helps!

share|improve this answer
Unfortunately it didnt work, printers still there :( - script shows it ran successfully but... I'm using admin account to run the script and it doesnt work but a regular user account can right click the printer and Remove Device without issue. It's like the scripts are just ignored.... So weird only have this issue in Win7, XP works great without issue. – bonedog73 Aug 7 '12 at 14:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .