Don't modify the ComputerInGroup.udf
Since you only have 4 printers, it would be easiest to write the code for each printer. You may want to check to see if it is already mapped using PriMapState.udf and set it to default using SetDefaultPrinter.
I know there is a way to use an array so you don't have to create the script for each printer, but will have to research this, as I, too am a new Kixtart user.
Change your script to this:
code:
$prtpod1="\\server\share1"
$prtpod2="\\server\share2"
$prtpod3="\\server\share3"
$prtpod4="\\server\share4"
call @scriptdir+'\computeringroup.udf'
if ComputerInGroup('Bruns Pod')=1 AND INSTR("$ipadd","10.1.1.")
if not PriMapState($prtpod1)
? "Status " $prtpod1 " not connected"
? @serror
$nul=AddPrinterConnection(\\server\$prtpod1)
? "Status - Added printer connection "$prtpod1
? @serror
$nul=SetDefaultPrinter($prtpod1)
? "Status - Default printer set "$prtpod1
endif
endif
Edited to include proper syntax. Thanks Howard, missed that.
tjcarst
[ 21. October 2003, 21:44: Message edited by: tjcarst ]