Solved

Can I run PrintUI.DLL silently via login script?

Posted on 2014-01-23
3
1,550 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

I've always wanted to allow a user to have a printer no matter where they login. The steps below will show you how to achieve just that. In this Article I'll show how to deploy printers automatically with group policy and then using security fil…
Ever notice how you can't use a new drive in Windows without having Windows assigning a Disk Signature?  Ever have a signature collision problem (especially with Virtual Machines?)  This article is intended to help you understand what's going on and…
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…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

770 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