Solved

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

Posted on 2008-10-01
10
2,974 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 
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:Paolo Santiangeli
ID: 22623764
0
 
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

Create the perfect environment for any meeting

You might have a modern environment with all sorts of high-tech equipment, but what makes it worthwhile is how you seamlessly bring together the presentation with audio, video and lighting. The ATEN Control System provides integrated control and system automation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

726 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