Link to home
Start Free TrialLog in
Avatar of deanavey
deanavey

asked on

cmd add printer conditionals

I've successfully gotten my script file to add network printers to each PC when a user logs on, however I want to clarify a few things that I'm struggling with.
I need a way to essentially check to see if those printers are already installed first, and if they are, end the script, if not, then delete the old network printers from the old server, and install these new ones. Whats happening now is every time the user logs on, whether the printers are installed or not, they reinstall anyway. I know I'm probably better in vbs, but this is all I have to work with right now.

Here is my current script for the printers, excluding my mapped drive cmd lines..

REM Add printer
 RunDll32.EXE printui.dll,PrintUIEntry /in /n "\\servername\TOSHIBA e-STUDIO7030cPRO PCL 6"
     
REM Set Default Printer
 RunDll32.EXE printui.dll,PrintUIEntry /y /n "\\servername\TOSHIBA e-STUDIO7030cPRO PCL 6"

REM Add printer
 RunDll32.EXE printui.dll,PrintUIEntry /in /n "\\servername\TOSHIBA e-STUDIO5530cPRO RPCS"

REM Add printer
 RunDll32.EXE printui.dll,PrintUIEntry /in /n "\\servername\TOSHIBA e-STUDIO5530cPRO PS"


I'm not super talented at scripts and I've tried to read the long lists of cmds that MS puts out or general users, but its all starting to run together and I just need someone to at least help me with the general structure =\.

Thanks for any help you can provide!

ASKER CERTIFIED SOLUTION
Avatar of 5g6tdcv4
5g6tdcv4
Flag of United States of America 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
SOLUTION
Avatar of Steve Knight
Steve Knight
Flag of United Kingdom of Great Britain and Northern Ireland 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
Sorry missed the bit about deleting the old printers... v.messy in command, better in VBS like has been said :-)
Avatar of deanavey
deanavey

ASKER

Thanks for the help guys!