This may shed some light:
code:
$Index = 0
$PrinterSet = 0
$NonPrinterGrps = "Domain Users,Domain Admins,Some Other Grps"
$Domain = "@Ldomain\"
? "Domain=" + $Domain
DO
$Group = ENUMGROUP($Index)
? "Group[" + $Index + "]=" + $Group
if instr($Group, $Domain)
$Group = substr($Group,len($Domain)+1)
if instr($NonPrinterGrps, $Group)=0
$file = "@lserver\netlogon\corp\printer.ini"
if exist ($file)
? "Found $file"
else
? "Error: file: $file not found"
endif
$Printer = ReadProfileString($file, "Printers", "$Group")
? @error @serror " ReadProfileString " + $Printer
if $Printer <> ""
$rc = SetDefaultPrinter ($Printer)
? "SetDefaultPrinter returned error code: " + $rc
$PrinterSet = 1
endif
else
? "Instr for NonPrinterGrps returned: " + instr($NonPrinterGrps, $Group)
endif
else
? "Instr for " + $Domain + " returned: " + instr($Group, $Domain)
endif
$Index=$Index+1
UNTIL $PrinterSet=1 or Len($Group) = 0



[ 03 April 2002, 06:41: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/