I'm working on a script that uses ENUMKEY to list the values of the subkeys that are Microsoft Patches. I'm trying to get the script to take each $KEYNAME and write it to a comma delimited file starting with the $SRVNAME. What's the easiest way to do this? I know I could do it with a write line and name a section for each server, but that can't be sorted easily. Any help? Thanks!!

OPEN (1,"C:\PROGRAM FILES\KIXTART\NASERVERS.TXT",2)

:NextServer

$SRVNAME = ReadLine(1)
IF $SRVNAME = ""
Goto ENDOFFILE
Endif


$Index1 = 0
:LOOP1
$KeyName=EnumKey("\\$SRVNAME\HKLM\Software\Microsoft\Updates\Windows

2000\SP4",$Index1)
? "$KeyName"

IF @ERROR = 0
$Index1 = $Index1 + 1
GOTO LOOP1
ENDIF


$Index2 = 0
:LOOP2
$KeyName=EnumKey("\\$SRVNAME\HKLM\Software\Microsoft\Updates\Windows

2000\SP5",$Index2)
? "$KeyName"
IF @ERROR = 0
$Index2 = $Index2 + 1
GOTO LOOP2
ENDIF

GOTO NextServer

:ENDOFFILE