thanks.

here's the code that I've got. It reads the registry for the printers and puts them in an array.

 Code:
Dim $sRootKey
$sRootKey="HKCU\Software\Microsoft\Windows NT\CurrentVersion\PrinterPorts\"
 
Dim $asSub,$sSub, $name, $sSpl, $j
	Redim $asPrinters[0]
	$j = 0
	
	$asSub=ReadRegValArr($sRootKey)
		For Each $sSub in $asSub
		$name=split($sSub,"\")
		$name=$name[ubound($name)]
		Redim Preserve $asPrinters[$j]
		$asPrinters[$j] = $name
		$j = $j + 1
		Next

		For Each $sPrinter in $asPrinters
		"	Printer: "+$sPrinter+@CRLF
		Next
Exit 0
   
Function ReadRegValArr($sKey)
	Dim $i,$sSubKey
 	Redim $ReadRegValArr[0]
 	$i=0
	$sSubKey=EnumValue($sKey,$i)	
	While Not @ERROR
		ReDim Preserve $ReadRegValArr[$i]
		$ReadRegValArr[$i]=$sSubKey		
		$i=$i+1
		$sSubKey=EnumValue($sKey,$i)	
	Loop
	If @ERROR=259 Exit 0 Else Exit @ERROR EndIf
EndFunction


regards,

jeroen