Hi there.
I'm new to this forum (and Kix scripting itself!) so Im sorry if I put this in the wrong area.
I work for a computer company that does work for a local high school. The school has one printer per room, and they wish for the login script to pick the printer that is in the room with any given machine, and make it the default.
A section of the script I have to do this is as follows:
code:
IF
@WKSTA = "D1-PC01" OR
@WKSTA = "D1-PC02" OR
@WKSTA = "D1-PC03" OR
@WKSTA = "D1-PC03" OR
@WKSTA = "D1-PC04" OR
@WKSTA = "D1-PC05" OR
@WKSTA = "D1-PC06" OR
@WKSTA = "D1-PC07" OR
@WKSTA = "D1-PC08" OR
@WKSTA = "D1-PC09" OR
@WKSTA = "D1-PC10" OR
@WKSTA = "D1-PC11" OR
@WKSTA = "D1-PC12" OR
@WKSTA = "D1-PC13" OR
@WKSTA = "D1-PC14" OR
@WKSTA = "D1-PC15" OR
@WKSTA = "D1-PC16" OR
@WKSTA = "D1-PC17" OR
@WKSTA = "D1-PC18" OR
@WKSTA = "D1-PC19" OR
@WKSTA = "D1-PC20" OR
@WKSTA = "LEAT 30"
$PrinterName = "\\TCW2KS01\D1-HP4Si"
CALL "@LSERVER\NetLogon\Scripts\dfltpntr.kix"
ENDIF
This is just for one classroom, and whilst it does work, its slow as hell! There are about 200 machine names in total and 80% of the time they start with (as in this case) "D1-(machine number)".
In order to speed up script execution, is there any way of using a wildcard after the 'D1-', and setting the printer from that IF? This way I would only have to go thru 20 lines of code as opposed to 200. I believe this would speed things up...is this likely to be the case, or am I barking up the wrong tree?
Hope you understand what Im getting at, and thanks for reading
I look forward to any help you can give.
Thanks, Ben.