Solved

Is there a way to delete all printers with the rundll32 printui.dll PrintUIEntry command?

Posted on 2008-10-01
10
2,844 Views
Last Modified: 2010-04-21
I have different printers installed on different machines, all with the /ga command.  Is there a way to delete them with the rundll32 command without specifying the server or printer name?
0
Comment
Question by:wolf2008
10 Comments
 
LVL 67

Expert Comment

by:sirbounty
ID: 22618095
Sure - there's a built-in script to do it...
run this from the command line:
cscript prnmngr.vbs -x -s %computername%

Open in new window

0
 
LVL 1

Author Comment

by:wolf2008
ID: 22618203
It looked like it worked at first, but when I logged off then on, the printers came back.
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 22618270
Logon script recreating them perhaps?
0
 
LVL 1

Author Comment

by:wolf2008
ID: 22618321
No logon scripts, either locally or through Group Policy.  I'm able to delete them with the /gd command, but you have to know each \\servername\printername and there are far too many combinations set on these computers.  There's gotta be a way to script it.
0
 
LVL 11

Expert Comment

by:psantiangeli
ID: 22623764
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 1

Author Comment

by:wolf2008
ID: 22624222
Did not work.  The printer came back when I restarted the Print Spooler Service.
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 22624236
I still think there's some automated method reproducing them...I ran the script on my system and my printers are gone...even after a reboot...
0
 
LVL 1

Author Comment

by:wolf2008
ID: 22624284
sirbounty: You added the printers with the "rundll32 printui.dll PrintUIEntry /ga /n\\server\printer" command?
0
 
LVL 21

Accepted Solution

by:
AmazingTech earned 500 total points
ID: 22657391
It's been about 2 years since I've played with the printui.dll so if my memory is a little hazy please give me some time to relearn this tool if needed. I will help you in every way. Need explanations just ask.

Want to delete all GAs?

The Reg Copy is just so we have a backup if we accidentally delete something we shouldn't have.

Of course with REG you can do this remotely as well.
reg copy HKLM\SYSTEM\CurrentControlSet\Control\Print\Connections HKLM\SYSTEM\CurrentControlSet\Control\Print\Connections.Saved /s /f

reg delete HKLM\SYSTEM\CurrentControlSet\Control\Print\Connections /f

Open in new window

0
 
LVL 1

Author Closing Comment

by:wolf2008
ID: 31407080
Thanks!  I tested it with both lines in a .bat file, and it worked.  I then created a .bat file with the following:

reg delete HKLM\SYSTEM\CurrentControlSet\Control\Print\Connections /f
net stop spooler
net start spooler
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Citrix XenApp, Internet Explorer 11 set to Enterprise Mode and using central hosted sites.xml file.
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now