it does not matter.
I thought about it too before posted the code.
when there is no printer, the addprinterconnection just fails to connect the printer, right?
so, it's fine to be there.
for 706 the problem is there.
you have 2 choices.
either share the same printer again with another name too or I will modify the script.
you could have something like:
Code:
if substr(@wksta,1,3) = "PTE"
$Room = substr(@wksta,4,4)
if substr($Room,1,1) = "0" $Room = substr($Room,2) endif
if $Room = "706" $Room = "705" endif ;706 does not have printer, using the one from 705.
$retval = AddPrinterConnection("\\PTPServerName\HPlaserjet"+$Room)
$retval = SetDefaultPrinter("\\PTPServerName\HPlaserjet"+$Room)
$retval = AddPrinterConnection("\\PTPServerName\HP"+$Room)
endif