Se hai perso o dimenticato dove avevi memorizzato il codice Product Key di Windows, ho una soluzione per te. Oggi vedremo come utilizzare un semplice script VBS per mostrarci il codice Product Key di una copia installata di Windows 10, Windows 8 o Windows 7. È una semplice soluzione per estrarre il codice Product Key dal sistema operativo installato sul PC senza utilizzando qualsiasi software di terze parti. Eccoci qui.
Pubblicità
In realtà, prima ho pubblicato un file soluzione simile che ha utilizzato PowerShell. ma molti utenti si sono lamentati del fatto che non funziona per loro. PowerShell potrebbe richiedere competenze utente aggiuntive e ulteriori modifiche per eseguire cmdlet non firmati.
quando è uscito l'iPhone 6?
Rispetto a PowerShell, questa soluzione VBScript è quasi perfetta. Tutto quello che devi fare è semplicemente fare clic sul file. Per visualizzare il codice Product Key di Windows 10
- Apri Blocco note.
- Copia e incolla il testo seguente nella finestra Blocco note
Opzione Explicit Dim objshell, path, DigitalID, Result Set objshell = CreateObject ('WScript.Shell') 'Set registry key path Path =' HKLM SOFTWARE Microsoft Windows NT CurrentVersion '' Registry key value DigitalID = objshell.RegRead (Path & 'DigitalProductId') Dim ProductName, ProductID, ProductKey, ProductData 'Get ProductName, ProductID, ProductKey ProductName =' Product Name: '& objshell.RegRead (Path &' ProductName ') ProductID =' Product ID: '& objshell. RegRead (Path & 'ProductID') ProductKey = 'Chiave installata:' & ConvertToKey (DigitalID) ProductData = ProductName & vbNewLine & ProductID & vbNewLine & ProductKey 'Mostra messbox se salva in un file If vbYes = MsgBox (ProductData & vblf & vblf & 'Salva in un file?', VbYesNo + vbQuestion, 'BackUp Windows Key Information') quindi Salva ProductData End If 'Converti binario in caratteri Funzione ConvertToKey (Key) Const KeyOffset = 52 Dim isWin8, Maps, i, j, Current, KeyOutput , Last, keypart1, insert '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 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 Mentre i> = 0 If (isWin8 = 1) Then keypart1 = Mid (KeyOutput, 2, Last) insert = 'N' KeyOutput = Replace (KeyOutput, keypart1, keypart1 & insert, 2, 1, 0) If Last = 0 Then KeyOutput = insert & 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 ')' Ottieni il nome utente corrente UserName = objshell.ExpandEnvironmentStrings ('% UserName%') 'Crea un file di testo sul desktop fName =' C: Users '& UserName &' Desktop WindowsKeyI nfo.txt 'Set fso = CreateObject (' Scripting.FileSystemObject ') Set txt = fso.CreateTextFile (fName) txt.Writeline Data txt.Close End Function
- Salva il testo sopra in un file con estensione '.vbs' sul desktop.
Suggerimento bonus: per assicurarti di salvare il file correttamente con l'estensione '.vbs', puoi digitarne il nome racchiuso tra virgolette doppie, ad esempio 'BackupWindowsKey.vbs'.
- Ora apri il tuo file BackupWindowsKey.vbs
- Voilà, il codice Product Key viene visualizzato sullo schermo!
Fare clic qui per scaricare il file BackupWindowsKey.vbs
Ho provato questo trucco su Windows 7, Windows 8 e Windows 10. Funziona perfettamente in tutti i sistemi operativi menzionati. Crediti: nononsence @ MDL .