Solved

Can I run PrintUI.DLL silently via login script?

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

Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

Question has a verified solution.

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

Suggested Solutions

ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
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…
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…

839 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