Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Can I run PrintUI.DLL silently via login script?

Posted on 2014-01-23
3
Medium Priority
?
1,881 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
[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
3 Comments
 
LVL 12

Assisted Solution

by:mlongoh
mlongoh earned 400 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 1600 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

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…
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…
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…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

604 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