here try this your code looks ok, these are NT computers right?

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

select
case $what_rm <= 29
At (4,4) "This is connecting to U26"
;addprinterconnection(\\upperserver\KyoU26)
;addprinterconnection(\\upperserver\EpsonU26)
case $what_rm >= 30
AT (4,4) "This is connecting to U18"
;addprinterconnection(\\upperserver\KyoU18)
;addprinterconnection(\\upperserver\EpsonU18)
endselect
------------------------------------------