I found out what the problem was already resolved and the network administrator has placed the group as "local" and not the Network group, which is why the groups were not being display in the script of Richard.

Thanks for everyone's help, the script is working perfectly now.

Ini File:
 Code:
[DOMAIN\Print DEMAN]
Printers=\\Server01\HP-2015-Deman
Default=\\Server01\HP-2015-Deman

[DOMAIN\Print SMAQF1]
Printers=\\Server01\HP-1320-SMAQF1
Default=\\Server01\HP-1320-SMAQF1

[DOMAIN\Print SMAQF2]
Printers=\\Server01\HP-2015-SMAQF2
Default=\\Server01\HP-2015-SMAQF2

[DOMAIN\Print UGB02]
Printers=\\Server01\HP-2015-UGB02
Default=\\Server01\HP-2015-UGB02


Script:
 Code:
Break ON
CLS

; Altera o Titulo da Janela do MS-DOS
SetTitle ("Nome da Empresa [KiXtart @Kix]")

;================================================================
;= Função        : DelPrinterConnections
;= Autor         : Lonkero
;= UDF Site      : http://www.kixtart.org/UDF/UDF_lister.php?what=post&code=83797
;= Contribuintes : Nenhum
;= Changes       : Roberto Valentim
;= Descrição     : Deleta todas as impressoas que foram adicionadas
;=                  apartir do servidor informado pelo parametro
;=                  $Server que devera ser informado.
;= Sintaxe       : DelPrinterConnections($Server)
;= Parâmetros    : $Server
;=                 Nome do Servidor
;= Retorna       : Nada
;= Dependências  : Nenhuma
;= Exemplo(s)    : DelPrinterConnections("Servidor01")
;================================================================
Function DelPrinterConnections($Server)
;================================================================
	DIM $c, $bk, $conn, $Index, $KeyName[5], $element
	$c = 0
	$bk = "HKEY_CURRENT_USER\Printers\Connections"
	For $Index = 0 to 5
		$KeyName[$Index] = EnumKey($bk, $Index)
	Next
	For Each $element in $KeyName
		$conn = enumkey($bk,$c)
		If (SubStr($element,3,12) = $Server) = 0
			$c= $c + 1
			$conn= delkey($bk + "\" + $conn)
			$conn= enumkey($bk,$c)
		EndIf
	Next
EndFunction

;================================================================
;= Função        : ENumGroupIni
;= Autor         : Kent Dyer
;= UDF Site      : http://www.kixtart.org/UDF/UDF_lister.php?what=post&code=84431
;= Contribuintes : Jens Meyer
;=                 Howard Bullock
;= Changes       : Roberto Valentim
;= Descrição     : Numera todos os grupos que estão no arquivo ini
;=                  que deverá ser informado pelo parametro $file
;=                  e o servidor no qual o grupo faz parte pelo
;=                  pelo parametro $Server.
;= Sintaxe       : ENumGroupIni($file)
;= Parâmetros    : $file
;=                 Arquivo para ser lido e usado
;= Retorna       : Nada
;= Dependências  : Nenhuma
;= Exemplo(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") = 0
				$InGroups = $InGroups + "$Grupo"
	      $GrpChave = split(readprofilestring($file, $Grupo, ""), chr(10))
				For Each $Chave in $GrpChave
					If ($Chave = "Printers")
						$Valores = split(readprofilestring($file, $Grupo, $Chave), ",")
						For Each $Valor in $Valores
							AddPrinterConnection("$Valor)
						Next
					EndIf

					If ($Chave = "Default")
						$Valores = split(readprofilestring($file, $Grupo, $Chave), ",")
						For Each $Valor in $Valores
							SetDefaultPrinter("$Valor)
						Next
					EndIf
				Next
			Else
			EndIf
		EndIf
	Next
EndFunction

DelPrinterConnections("Server01")

ENumGroupIni("print.ini")


Edited by Valentim (2010-01-08 11:55 AM)
_________________________