Heres kind of an over-wrought start, change $input to be your input file and $output to be your new output file, change the $w2k3 variable depending and then add more keys for other OS's ... would even be cool to dynamically enum the higher level keys use a table of SP's for your search, anyway:

Code:

break on

$input = ".\input.txt"
$output = ".\output.txt"

$W2K3 = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates\Windows Server 2003\sp1"

if open(1,$input) = 0

if exist($output)
del "$output"
endif

if open(2,$output,5) = 0

$server = readline(1)

while $server

$str = $server

$i = 0

$key = enumkey("\\$server\"+$w2K3,$i)

while $key
$str = $str + "," + $key
$i=$i+1
$key = enumkey("\\$server\"+$w2K3,$i)
loop

$= writeline(2,$str+@CRLF)

$server = readline(1)

loop

$= close(2)

endif

$=close(1)

endif

exit 1



Copy this code into wordpad and then copy/paste into notepad to get proper formatting, hope this helps.

-Shawn