We help IT Professionals succeed at work.

printui.dll batch scripting

AV_
AV_ asked
on
416 Views
Last Modified: 2010-08-05
Hi,

I'm currently assigning printers to users via the OU they reside in in AD.

E.G. to attach John Smith in Sales to the default sales printer I use the following script attached to the OU in which sales users are placed (user config \ windows settings\ scripts(logon / logoff) \ logon\ %path%\batchfile.bat)

rundll32 printui.dll,PrintUIEntry /in /n \\server\printer
rundll32 printui.dll,PrintUIEntry /y /n \\server\printer

this adds the printer and sets it as default.

Is there a way to check if the printer is already installed and at that point skip the installation / and setting it as default? This would make the script more effiecient and prevent any preferences for default printer being overwritten.

My batch file skills are rusty, but presume this can be done with relevant IF statement and :sections.

Any help much appreciated!

p.s. there's useful info on printui @

http://www.robvanderwoude.com/2kprintcontrol.html


Comment
Watch Question

Systems Engineer
CERTIFIED EXPERT
Top Expert 2007
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
AV_

Author

Commented:
neat solution - cheers
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.