Hi,
hier ein miniscript, was die win-id und den win-key ausliest.
[autoit];
; WinGetKey
;
; © sc4ry
#include <guiconstants.au3>
#include <string.au3>
Opt("TrayMenuMode",1)
TraySetToolTip("sc4ry´s " & @ScriptName & @CRLF & @UserName & " \\ " & @ComputerName & @CRLF & @OSVersion & " " & @OSServicePack & " \\ " & @OSBuild & @CRLF & @IPAddress1)
$flag = 0
Global $menu, $copyid, $copykey
$ID = RegRead("HKLM\Software\Microsoft\Windows NT\CurrentVersion", "ProductId")
$Bin = RegRead("HKLM\Software\Microsoft\Windows NT\CurrentVersion", "DigitalProductId")
If $flag = 0 Then GUICreate("WinGetKey", 300, 120, -1, -1, $WS_POPUP + $WS_DLGFRAME, $WS_EX_TOPMOST) ;normal(bild + buttons, kein menu)
If $flag = 1 Then GUICreate("WinGetKey", 300, 120, -1, -1, $WS_POPUP + $WS_DLGFRAME, $WS_EX_TOPMOST) ;picless(ohne bild + menu, mit buttons)
If $flag = 2 Then GUICreate("WinGetKey", 260, 140, -1, -1, $WS_POPUP + $WS_DLGFRAME, $WS_EX_TOPMOST) ;buttonless (mit bild + menu, ohne buttons)
If $flag <> 1 Then GUICtrlCreatePic("C:\Dokumente und Einstellungen\Administrator\Lokale Einstellungen\Anwendungsdaten\Microsoft\Wallpaper1.bmp", 0, 0, 370, 190)
If $flag <> 1 Then GUICtrlSetState(-1, $GUI_DISABLE)
If $flag = 2 Then $menu = GUICtrlCreateMenu("©...")
If $flag = 2 Then $copyid = GUICtrlCreateMenuItem("&ID (ALT+C+I)", $menu)
If $flag = 2 Then $copykey = GUICtrlCreateMenuItem("&Key (ALT+C+K)", $menu)
If $flag <> 2 Then $copyid = GUICtrlCreateButton("copy &ID", 245, 30, 50, 20)
If $flag <> 2 Then $copykey = GUICtrlCreateButton("copy &Key", 245, 80, 50, 20)
GUICtrlCreateLabel("Product ID", 10, 10, 53, 15)
GUICtrlCreateLabel("Product Key", 10, 60, 60, 15)
$IID = GUICtrlCreateInput("", 10, 30, 230, 20, $ES_READONLY)
GUICtrlSetData($IID, $ID)
$IKey = GUICtrlCreateInput("", 10, 80, 230, 20, $ES_READONLY)
GUICtrlSetData($IKey, DecodeProductKey($Bin))
GUISetState(@sw_show)
While 1
$msg = GUIGetMsg()
Select
case $msg = $gui_event_close
Exit
case $msg = $copyid
ClipPut(guictrlread($IID))
case $msg = $copykey
ClipPut(guictrlread($IKey))
EndSelect
WEnd
Func DecodeProductKey($BinaryDPID)
Local $bKey[15]
Local $sKey[29]
Local $Digits[24]
Local $Value = 0
Local $hi = 0
Local $n = 0
Local $i = 0
Local $dlen = 29
Local $slen = 15
Local $Result
$Digits = StringSplit("BCDFGHJKMPQRTVWXY2346789", "")
$BinaryDPID = StringMid($BinaryDPID, 105, 30)
For $i = 1 To 29 Step 2
$bKey[Int($i / 2) ] = Dec(StringMid($BinaryDPID, $i, 2))
Next
For $i = $dlen - 1 To 0 Step - 1
If Mod(($i + 1), 6) = 0 Then
$sKey[$i] = "-"
Else
$hi = 0
For $n = $slen - 1 To 0 Step - 1
$Value = BitOR(BitShift($hi, -8), $bKey[$n])
$bKey[$n] = Int($Value / 24)
$hi = Mod($Value, 24)
Next
$sKey[$i] = $Digits[$hi + 1]
EndIf
Next
For $i = 0 To 28
$Result = $Result & $sKey[$i]
Next
Return $Result
EndFunc ;==>DecodeProductKey