|
Trying to use a very simple printer mapping script that looks to the computer name. The scrip keeps mapping all the printers regardless of the computer name! Any ideas??
;*******************************************
;NT/2K/XP workstation variables (set using SET command)
SET COMPUTER="@WKSTA"
;******************************************************
IF @WKSTA ("S101"|"S102"|"S103"|"S104"|"S105"|"S106"|"S107"|"S108"|"S109"|"S110"|"S111 "|"S112"|"S113"|"S114"|"S215"|"S116"|"S117"|"S118"|"S119"|"S120"|"S121"|"S12 2"|"S123"|"S124"|"S125"|"S126"|"S127"|"S128"|"S129"|"S130") IF AddPrinterConnection ("\\admin1\ICT1_Las") = 1 MESSAGEBOX ("ICT1 Laser Printer connection failed","Printer Connection Error!",0) ENDIF ENDIF
;********************************************************
IF @WKSTA ("S201"|"S202"|"S203"|"S204"|"S205"|"S206"|"S207"|"S208"|"S209"|"S210"|"S211 "|"S212"|"S213"|"S214"|"S215"|"S216"|"S217"|"S218"|"S219"|"S220"|"S221"|"S22 2"|"S223"|"S224"|"S225"|"S226"|"S227"|"S228"|"S229"|"S230") IF AddPrinterConnection ("\\admin1\ICT2_Las") = 1 MESSAGEBOX ("ICT2 Laser Printer connection failed","Printer Connection Error!",0) ENDIF ENDIF
;********************************************************
IF @WKSTA ("S301"|"S302"|"S303"|"S304"|"S305"|"S306"|"S307"|"S308"|"S309"|"S310"|"S311 "|"S312"|"S313"|"S314"|"S315"|"S316"|"S317"|"S318"|"S319"|"S320"|"S321"|"S32 2"|"S323"|"S324"|"S325"|"S326"|"S327"|"S328"|"S329"|"S330") IF AddPrinterConnection ("\\admin1\ICT3_Las") = 1 MESSAGEBOX ("ICT3 Laser Printer connection failed","Printer Connection Error!",0) ENDIF ENDIF
;********************************************************
IF @WKSTA ("S401"|"S402"|"S403"|"S404"|"S405"|"S406"|"S407"|"S408"|"S409"|"S410") IF AddPrinterConnection ("\\admin1\ICT4_Las") = 1 MESSAGEBOX ("ICT4 Laser Printer connection failed","Printer Connection Error!",0) ENDIF ENDIF
;********************************************************
IF @WKSTA ("TECHNICIAN01") IF AddPrinterConnection ("\\technician02\Technician") = 1 MESSAGEBOX ("Technician Laser Printer connection failed","Printer Connection Error!",0) ENDIF ENDIF
;********************************************************
IF @WKSTA ("ART01"|"ART02") IF AddPrinterConnection ("\\admin1\Art_Col") = 1 MESSAGEBOX ("Art Laser Colour connection failed","Printer Connection Error!",0) ENDIF ENDIF
;****************************************************
|