Windows – Unable to remove network printers via script in Windows 7

network-printerscriptwindows 7

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

and

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..

Best Answer

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

Related Question