i am using the actual printer name. i shared the printer with the same as the installed name. I am using kixtart 4.02.Heres what im working with now.
code:
$wksta=@wksta
$a=substr($wksta,6,2) ;take last two char
$what_rm = val($a) ;change to numberdelprinterconnection(\\upper01\KyoU26)
delprinterconnection(\\upperserver\EpsonU25)
delprinterconnection(\\upperserver\EpsonA3)
delprinterconnection(\\upperserver\EpsonU18)
;******* ROOM 26 *******
select
case $what_rm <= 30
if addprinterconnection("\\Upper01\KyoU26") = 0
at (15,22) "Laser Printer Connected"
endif
;addprinterconnection("\\Upperserver\EpsonU25")
if setdefaultprinter("\\Upper01\KyoU26") = 0
AT (15,22) "Laser Printer Connected (Default)"
;AT (16,22) "Connected Color Printer"
endif
;****** ROOM 18 ********
case $what_rm >= 30
if addprinterconnection("\\upperserver\EpsonU18") = 0
at (15,22) "Colour Printer Connected"
endif
;addprinterconnection("\\upperserver\EpsonA3")
if setdefaultprinter("\\upperserver\EpsonU18") = 0
AT (15,22) "Colour Printer Connected (Default)"
endif
endselect
return
i cant see anything wrong with the code. I have also discovered that when i debug it as an administrator it works fine, but when a restricture user logs on such as a student, they dont get a default printer. This has only just started doing this and has worked with past version. could it be a bug??
Mike
[ 20 February 2002: Message edited by: mcloum ]