Sorry about this folks but i changed the "function" to SUBSTR and its not connecting to the correct printers, im using 1 machine in room 1 and its connecting to the Laser printer in room 2 ?????

heres the script i currently have, is anything wrong with it?

;************
$wksta=@wksta
$a=substr($wksta,5,2) ;take last two char
$what_rm=val($a) ;change to number

if $what_rm > 30
addprinterconnection(\\upperserver\EpsonU18)
addprinterconnection(\\upperserver\KyoU18)
else
addprinterconnection(\\upperserver\KyoU26)
addprinterconnection(\\upperserver\EpsonU26)
endif
;******************