Come visualizzare il codice Product Key in Windows 10, Windows 8 e Windows 7
Se hai perso o dimenticato dove hai archiviato il codice Product Key di Windows, ho una soluzione per te. Oggi vedremo come un semplice script VBS può essere utilizzato per mostrarci il product key di una copia installata di Windows 10, Windows 8 o Windows 7. È una soluzione semplice per estrarre la chiave del prodotto dal sistema operativo installato sul PC senza utilizzare software di terze parti. Eccoci qui.
Annuncio
In realtà, prima ho postato a soluzione simile che usava PowerShell. ma molti utenti si sono lamentati del fatto che non funziona per loro. PowerShell potrebbe richiedere ulteriori competenze utente e ulteriori modifiche per eseguire cmdlet non firmati.
Rispetto a PowerShell, questa soluzione VBScript è quasi perfetta. Tutto quello che devi fare è fare clic sul file. Per visualizza il codice Product Key di Windows 10
- Apri Blocco note.
- Copia e incolla il seguente testo nella finestra del Blocco note
Opzione esplicita. Dim objshell, percorso, DigitalID, Risultato. Imposta objshell = CreateObject("WScript. Shell") 'Imposta percorso chiave di registro Path = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\" 'Valore chiave di registro DigitalID = objshell. RegRead (Path & "DigitalProductId") Dim ProductName, ProductID, ProductKey, ProductData 'Get ProductName, ProductID, ProductKey ProductName = "Product Name: " & objshell. RegRead (Path & "ProductName") ProductID = "ID prodotto: " & objshell. RegRead (Path & "ProductID") ProductKey = "Chiave installata: " & ConvertToKey (DigitalID) ProductData = ProductName & vbNewLine & ProductID & vbNewLine & ProductKey 'Mostra casella di posta se salvato in un file. Se vbYes = MsgBox (ProductData & vblf & vblf & "Salva in un file?", vbYesNo + vbQuestion, "Backup delle informazioni chiave di Windows"), salva ProductData. Finisci se. 'Converti binario in caratteri Funzione ConvertToKey (Key) Const KeyOffset = 52 Dim isWin8, Maps, i, j, Current, KeyOutput, Last, keypart1, inserisci 'Controlla se il sistema operativo è Windows 8 isWin8 = (Key (66) \ 6) And 1 Key (66) = (Key (66) And &HF7) Or ((isWin8 And 2) * 4) i = 24 Maps = "BCDFGHJKMPQRTVWXY2346789" Do Current= 0 j = 14 Do Current = Current * 256 Corrente = Tasto (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 = Ciclo di corrente mentre i >= 0. If (isWin8 = 1) Allora keypart1 = Mid (KeyOutput, 2, Last) insert = "N" KeyOutput = Sostituisci (KeyOutput, keypart1, keypart1 & insert, 2, 1, 0) If Last = 0 Allora KeyOutput = inserisci & KeyOutput End If. ConvertToKey = Mid (KeyOutput, 1, 5) & "-" & Mid (KeyOutput, 6, 5) & "-" & Mid (KeyOutput, 11, 5) & "-" & Mid (KeyOutput, 16, 5) & "-" & Mid (KeyOutput, 21, 5) End Function 'Salva i dati in un file Funzione Save (Data) Dim fso, fName, txt, objshell, UserName Set objshell = CreateObject("wscript.shell") 'Get current nome utente. UserName = objshell. ExpandEnvironmentStrings("%UserName%") 'Crea un file di testo sul desktop. fName = "C:\Users\" & UserName & "\Desktop\WindowsKeyInfo.txt" Set fso = CreateObject("Scripting. FileSystemObject") Imposta txt = fso. CreateTextFile (fName) txt. Scrivi i dati della riga txt. Chiudi la funzione di fine
- Salva il testo sopra in un file con estensione ".vbs" sul desktop.
Suggerimento bonus: per assicurarti di salvare correttamente il file con l'estensione ".vbs", puoi digitarne il nome racchiuso tra virgolette, ad esempio "BackupWindowsKey.vbs". - Ora apri il tuo file BackupWindowsKey.vbs
- Voilà, il codice prodotto viene visualizzato sullo schermo!
Fare clic qui per scaricare il file BackupWindowsKey.vbs
Ho testato questo trucco su Windows 7, Windows 8 e Windows 10. Funziona perfettamente in tutti i sistemi operativi menzionati. Titoli di coda: sciocchezze @ MDL.