Страница 1 из 1

Как узнать серийный номер установленной Win XP Prof RU

Добавлено: 17 июн 2009 16:36, Ср
Timka

Создаём файлик с расширением .vbs и следующим содержанием:

Код: Выделить всё

Set WshShell = WScript.CreateObject("WScript.Shell")
strDigitalProductId="HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DigitalProductId"
strOffXPRU="HKLM\SOFTWARE\Microsoft\Office\10.0\Registration\{91110419-6000-11D3-8CFE-0050048383C9}\DigitalProductId"
 
strXPKey=GetKey(WshShell.RegRead(strDigitalProductId))
'strOffXPRUKey=GetKey(WshShell.RegRead(strOffXPRU))
 
'CopytoClipboard
set ie=CreateObject("internetExplorer.application")
ie.navigate "about:blank"
do until ie.readystate=4: wscript.sleep 1: loop
ie.document.parentwindow.clipboardData.setData "Text", strXPKey
 
 
MsgBox "WinXP:"&strXPKey&chr(13)&_
"key in clipboard"
' "OffXP:"&strOffXPRUKey
 
Function GetKey(rpk)
 
Const rpkOffset=52:i=28
szPossibleChars="BCDFGHJKMPQRTVWXY2346789"
 
Do 'Rep1
dwAccumulator=0 : j=14
Do 
dwAccumulator=dwAccumulator*256 
dwAccumulator=rpk(j+rpkOffset)+dwAccumulator
rpk(j+rpkOffset)=(dwAccumulator\24) and 255 
dwAccumulator=dwAccumulator Mod 24
j=j-1
Loop While j>=0
i=i-1 : szProductKey=mid(szPossibleChars,dwAccumulator+1,1)&szProductKey
if (((29-i) Mod 6)=0) and (i<>-1) then 
i=i-1 : szProductKey="-"&szProductKey
End If
Loop While i>=0 'Goto Rep1
 
GetKey=szProductKey
End Function

з.ы. Идея и код неизвестного автора.