Just to golf it down a little...

Code:

Break ON
$=SetOption("WrapAtEOL","ON")

function get_product_key ($sProductID)
Dim $aiKeyChars[24],$bProductKey[15],$ilByte,$i,$sCDKey

$aiKeyChars = Split('B,C,D,F,G,H,J,K,M,P,Q,R,T,V,W,X,Y,2,3,4,6,7,8,9',',')

for $i = 0 to 14
$bProductKey[$i] = val("&"+substr($sProductID,$i*2+105,2))
next

$sCDKey = ""
For $ilByte = 24 To 0 Step -1
$nCur = 0

For $i=14 To 0 Step -1
$nCur = $nCur * 256 | $bProductKey[$i]
$bProductKey[$i] = Int($nCur / 24)
$nCur = $nCur Mod 24
Next
$sCDKey = $aiKeyChars[$nCur] + $sCDKey
If $ilByte Mod 5 = 0 And $ilByte <> 0 $sCDKey = "-" + $sCDKey EndIf
Next
$get_product_key = $sCDKey
endfunction

$dpi=ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\Windows NT\CurrentVersion","DigitalProductID")
$key = get_product_key($dpi)
? "Windows Product Key: " + $key

? "Press any key..."
get $