damn i think that's my error came frome the name of the printer in the SetDefaultPrinter line ! but can't find the name to put....isn't supposed to be the share name ? \\server\printer ? like here -> \\PTE0705A06\HP705 ??
Heres the script i use @ this moment:
Code:
break on
if substr(@wksta,1,5) = "PTE07"
"part of PTE" ?
$Room = substr(@wksta,4,4)
"Room = " $Room ?
if substr($Room,1,1) = "0"
"Room started with zero, removing it." ?
$Room = substr($Room,2)
"Room is now " $Room ?
endif
"Connecting to Printer '\\PTE0705A06\HP705"
$retval = AddPrinterConnection("\\PTE0705A06\HP705)
@error ?
$retval = SetDefaultPrinter("\\PTE0705A06\HP705")
endif
[/core]
All working fine except the last line setdefaultprinter..
BAL.