$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