Hi BradV,

Yeah, He just gave me a code where I would have to create a "If InGroup (GroupX)" for each existing group.

Through this code he gave me this could create code that automatically gets all the groups, keys and values of the ini file

 Code:
;================================================================
;= Function    : ENumGroupIni
;= Author      : Roberto Valentim
;= Example(s)  : ENumGroupIni("C:\print.ini")
;================================================================
Function ENumGroupIni($file)
;================================================================
	DIM $GrpArray, $Grupo, $GrpChave, $Chave, $Valores, $Valor

	$GrpArray = split(readprofilestring($file, '', ''), chr(10))
	For Each $Grupo in $GrpArray
		If ($Grupo <> "")
			If InGroup($Grupo)
;				? "Grupo >> " + $Grupo
				$GrpChave = split(readprofilestring($file, $Grupo, ''), chr(10))
				For Each $Chave in $GrpChave
					If ($Chave = "Printers")
;						? "     Chave >> " + $Chave
						$Valores = split(readprofilestring($file, $Grupo, $Chave), ",")
						For Each $Valor in $Valores
							AddPrinterConnection("\\srv-jbgarq03\" + $Valor)
;							? "          Printers >> " + $Valor
						Next
					EndIf

					If ($Chave = "Default")
;						? "     Chave >> " + $Chave
						$Valores = split(readprofilestring($file, $Grupo, $Chave), ",")
						For Each $Valor in $Valores
							SetDefaultPrinter("\\srv-jbgarq03\" + $Valor) = 0
;							? "          Default >> " + $Valor
						Next
					EndIf
				Next
			EndIf
		EndIf
	Next
EndFunction


Mart, Thanks for the help and disclaims


Edited by Valentim (2010-01-05 02:37 PM)
_________________________