Link to home
Start Free TrialLog in
Avatar of AV_
AV_

asked on

printui.dll batch scripting

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


ASKER CERTIFIED SOLUTION
Avatar of Farhan Kazi
Farhan Kazi
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of AV_
AV_

ASKER

neat solution - cheers