Solved

Can I run PrintUI.DLL silently via login script?

Posted on 2014-01-23
3
1,664 Views
Last Modified: 2014-01-23
Here is my situation: I need to remove network shared printers from client computers. The printers were originally shared from a SBS03 box, but the SBS03 box is no longer on the network. AD and printer sharing has been taken over by a 2008r2 box. The problem is that many computers still have a connection to the printers shared from the SBS03 box. I have the following commands in my login script:
rundll32 printui.dll,PrintUIEntry /dn /n\\OLD_SERVER\PRINTER1
rundll32 printui.dll,PrintUIEntry /dn /n\\OLD_SERVER\PRINTER2

This is working well, but here is the snag: Every login after the first, the users get an error that states:

"Printer connection cannot be removed. Double check the printer name and make sure that the printer is connected to the network."

Is there a way to suppress messages from PrintUI.DLL or force it to run silently?

Thank you!
0
Comment
Question by:FuelSupport
3 Comments
 
LVL 12

Assisted Solution

by:mlongoh
mlongoh earned 100 total points
ID: 39803362
You can write a vbscript to run these two commands silently:

Set wsShell = CreateObject("wscript.shell")
wsShell.Run "rundll32 printui.dll,PrintUIEntry /dn /n\\OLD_SERVER\PRINTER1", 0, True
wsShell.Run "rundll32 printui.dll,PrintUIEntry /dn /n\\OLD_SERVER\PRINTER2", 0, True


Save the script as DelPrn.vbs, and set your logon script to run this script.
0
 
LVL 13

Accepted Solution

by:
Felix Leven earned 400 total points
ID: 39803364
/q quiet mode, do not display error messages
0
 

Author Closing Comment

by:FuelSupport
ID: 39805229
/Q is what I was looking for. Thank you!
0

Featured Post

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

INTRODUCTION The purpose of this document is to demonstrate the Installation and configuration of the Data Protection Manager product. Note that this demonstration was prepared on the basis of Windows OS is 2008 R2 and DPM 2010. DATA PROTECTI…
While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

730 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