Hello @Bree,
I do NOT
know if this will be of any use to you but this is part of a Script I wrote that might give you the Product Key
. I do NOT
know if it will work on Win 7 but it works on Win 10 & Win 11.
Copy & Paste
the following ALL at once into Notepad
and Save
it [ Desktop ] as a .bat
file and then run it.
Code:
@echo off
:: 10F_Bree
if not "%1"=="max" start /max cmd /c %0 max & Exit /b
:Product_Key_License
echo.
PowerShell Write-Host -ForegroundColor Red ^
""" ___ PRIVATE and CONFIDENTIAL ___ """ & echo.
>> %Temp%\A.vbs (
echo Option Explicit
echo Dim objshell, Path, DigitalID, Result
echo Set objshell = CreateObject("WScript.Shell"^)
echo '__ Set Registry Key Path __
echo Path = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\"
echo '__ Registry Key Value __
echo DigitalID = objshell.RegRead(Path ^& "DigitalProductId"^)
echo '__ Save Registry Key Value __
echo Dim ProductKey
echo ProductKey = ConvertToKey(DigitalID^)
echo Save ProductKey
echo '__ Convert Binary to Chars __
echo Function ConvertToKey(Key^)
echo Const KeyOffset = 52
echo Dim isWin8, Maps, i, j, Current, KeyOutput, Last, keypart1, insert
echo '__ Check if OS is Windows 8 __
echo isWin8 = (Key(66^) \ 6^) And 1
echo Key(66^) = (Key(66^) And ^&HF7^) Or ((isWin8 And 2^) * 4^)
echo i = 24
echo Maps = "BCDFGHJKMPQRTVWXY2346789"
echo Do
echo Current= 0
echo j = 14
echo Do
echo Current = Current * 256
echo Current = Key(j + KeyOffset^) + Current
echo Key(j + KeyOffset^) = (Current \ 24^)
echo Current=Current Mod 24
echo j = j -1
echo Loop While j ^>= 0
echo i = i -1
echo KeyOutput = Mid(Maps,Current+ 1, 1^) ^& KeyOutput
echo Last = Current
echo Loop While i ^>= 0
echo If (isWin8 = 1^) Then
echo keypart1 = Mid(KeyOutput, 2, Last^)
echo insert = "N"
echo KeyOutput = Replace(KeyOutput, keypart1, keypart1 ^& insert, 2, 1, 0^)
echo If Last = 0 Then KeyOutput = insert ^& KeyOutput
echo End If
echo ConvertToKey = Mid(KeyOutput, 1, 5^) ^& "-" ^& Mid(KeyOutput, 6, 5^) ^& "-" ^& Mid(KeyOutput, 11, 5^) ^& "-" ^& Mid(KeyOutput, 16, 5^) ^& "-" ^& Mid(KeyOutput, 21, 5^)
echo End Function
echo '__ Save Data to a Temp File __
echo Function Save(Data^)
echo Dim fso, fName, txt, objshell
echo Set objshell = CreateObject("wscript.shell"^)
echo '__ Create a Text File in Temp __
echo fName = "%LocalAppData%\Temp\Win_Key.txt"
echo Set fso = CreateObject("Scripting.FileSystemObject"^)
echo Set txt = fso.CreateTextFile(fName^)
echo txt.Writeline Data
echo txt.Close
echo End Function)
cscript /nologo %Temp%\A.vbs
PowerShell Write-Host ' "License/Product Key - Installed [Partial NON-BIOS/UEFI - SLMGR Current License] :"' (Get-CimInstance SoftwareLicensingProduct -Filter 'PartialProductKey is not Null' ^| Where-Object {$_.Name -Like '*Windows*'}).PartialProductKey
PowerShell Write-Host ' "License/Product Key - Installed [Full NON-BIOS/UEFI - SLMGR Current License] :"' (Get-Content %Temp%\Win_Key.txt)
PowerShell Write-Host ' "License/Product Key - Installed [BIOS/UEFI Original - OEM ONLY] :"' -NoNewline ;if([string]::IsNullOrWhiteSpace((Get-CimInstance -Query 'Select * from SoftwareLicensingService').OA3xOriginalProductKey)) {' NOT Present'} else {(Get-CimInstance -Query 'Select * from SoftwareLicensingService').OA3xOriginalProductKey}
PowerShell Write-Host ' "License/Product Key - Backup Default [Registry Key Entry] :"' (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform' -Name BackupProductKeyDefault).BackupProductKeyDefault
del %Temp%\A.vbs, %Temp%\Win_Key.txt
echo. & echo ^>Press ANY key to EXIT . . . & pause >nul & Exit
I hope this helps.