Ahh both very good points...

So sample .ini file...
 Code:
[00:25:9C:AD:43:D6]
Location = Location99
Group = Group97
Shares = Share 98:Share98,Share 99:Share99,Share 100:Share100,Share 101:Share101,Share 102:Share102


Sample code to use .ini file...(changed setdefault to use name, changed share and name to one variable with a delimiter, also brought out the ingroup check since they all seem to depend on it.)
 Code:
$mac = GetBSSID(1,@WkSta)
$location = ReadProfileString (@ScriptDir+"\info.ini", $mac, "Location")
$group = ReadProfileString (@ScriptDir+"\info.ini", $mac, "Group")
$shares = ReadProfileString (@ScriptDir+"\info.ini", $mac, "Shares")

If InGroup($group)
   If InStr($shares,",")
      $shares = Split($shares,",")
      $sharenum = 0
      For Each $shareobj in $shares
         $name = Split($shareobj,":")[0]
         $share = Split($shareobj,":")[1]
         If AddPrinterConnection("\\server\"+$share) = 0
            If $sharenum = UBound($shares)
               $null = SetDefaultPrinter("\\server\"+$name)
            EndIf
         Else
            $null = MessageBox("There seems to have been a problem connecting to : "+$share,"Printer Error",0)
         EndIf
         $sharenum = $sharenum+1
      Next
   Else
      $name = Split($shares,":")[0]
      $share = Split($shares,":")[1]
      If AddPrinterConnection("\\server\"+$share) = 0
         $null = SetDefaultPrinter("\\server\"+$name)
      Else
         $null = MessageBox("There seems to have been a problem connecting to : "+$shares,"Printer Error",0)
      EndIf
   EndIf
EndIf


Edited by Shanee (2010-11-06 06:00 PM)
Edit Reason: changed defaultprinter lines