Solved

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

Posted on 2008-10-01
10
3,036 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

No single Antivirus application (despite claims by manufacturers) will catch or protect you from all Virus / Malware or Spyware threats. That doesn't stop you from further protecting yourself however - and this article is to show you how.
In this post we will be converting StringData saved within a text file into a hash table. This can be further used in a PowerShell script for replacing settings that are dynamic in nature from environment to environment.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

696 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