Sådan får du vist din Windows 10-produktnøgle vha. Script

2019-09-25 18:27:05
Vigtigste·Microsoft·Sådan får du vist din Windows 10-produktnøgle vha. Script

Der er mange værktøjer til at udtrække produktnøglen fra et live-system eller fra registreringsdatabasehiven på en offline computer. Derudover er her et pænt lille Vbscript, der får produktnøglen til din nuværende Windows-installation - intet tredjepart-program kræves. Scriptet fungerer på Windows 7, 8 og Windows 10.

Se Windows 10-produktnøgle vha. Script

Kopier følgende kode til Notepad og gem filen som GetProductKey.vbs.

 Option Eksplicit Dim objshell, sti, DigitalID, Resultat Sæt objshell = CreateObject ("WScript.Shell") 'Indstil registernøglesti Path = "HKLM \ SOFTWARE \ Microsoft \ Windows NT \ CurrentVersion \"' Registernøgleværdi DigitalID = objshell.RegRead (Sti & "DigitalProductId") Dim Produktnavn, ProduktID, ProduktKey, ProduktData 'Hent Produktnavn, ProduktID, ProduktKey Produktnavn = "Produktnavn:" & objshell.RegRead (Sti & "Produktnavn") ProductID = "Produkt-ID:" & objshell. RegRead (Path & "ProductID") ProductKey = "Installeret nøgle:" & ConvertToKey (DigitalID) ProductData = ProductName & vbNewLine & ProductID & vbNewLine & ProductKey 'Vis messbox, hvis gemt i en fil Hvis vbYes = MsgBox (ProductData & vblf & vblf & "Gem i en fil?", VbYesNo + vbQuestion, "BackUp Windows Key Information"), og gem derefter ProductData Ende Hvis 'Konverter binært til chars Funktion ConvertToKey (Key) Const KeyOffset = 52 Dim isWin8, Maps, i, j, Current, KeyOutput, Sidst, tastatur1, indsæt 'Kontroller, om OS er Windows 8 erWin8 = (nøgle (66) \ 6) og 1 nøgle (66) = (Key (66) And & HF7) Or ((isWin8 And 2) * 4) i = 24 Maps = "BCDFGHJKMPQRTVWXY2346789" Do Current = 0 j = 14 Do Current = Current * 256 Current = Key (j + KeyOffset) + Current Key (j + KeyOffset) = (Current \ 24) Current = Current Mod 24 j = j -1 Loop While j> = 0 i = i -1 KeyOutput = Mid (Maps, Current + 1, 1) & KeyOutput Last = Current Loop Mens i> = 0 Hvis (erWin8 = 1) Derefter tastatur1 = Midt (KeyOutput, 2, Last) indsæt = "N" KeyOutput = Replace (KeyOutput, keypart1, keypart1 & insert, 2, 1, 0) If Last = 0 Then KeyOutput = insert & KeyOutput End Hvis ConvertToKey = Mid (KeyOutput, 1, 5) & "-" & Mid (KeyOutput, 6, 5) & "-" & Mid (KeyOutput, 11, 5) & "-" & Mid ( KeyOutput, 16, 5) & "-" & Mid (KeyOutput, 21, 5) Slutfunktion 'Gem data i en fil Funktion Gem (data) Dim fso, fName, txt, objshell, UserName Set objshell = CreateObject ("wscript. shell ") 'Hent aktuelt brugernavn Brugernavn = objshell.ExpandEnvelopStrings ("% Brugernavn% ")' Opret en tekstfil på skrivebordet fName =" C: \ Brugere \ "& Brugernavn &" \ Desktop \ WindowsKeyInf o.txt "Set fso = CreateObject (" Scripting.FileSystemObject ") Sæt txt = fso.CreateTextFile (fName) txt.Writeline Data txt.Luk slutfunktion 

Kilde: Hent Windows-produktnøgle · GitHub

Dobbeltklik for at køre scriptet for at finde ud af produktnøglen til din Windows-installation.

Redaktørens Valg