Как узнать ключ продукта

Аватар автора
Мастерство и Смысл Жизни
каманды Set-ExecutionPolicy RemoteSigned Set-ExecutionPolicy restricted код function Function GetWin10Key { $Hklm = 2147483650 $Target = $env:COMPUTERNAME $regPath = "SoftwareMicrosoftWindows NTCurrentVersion" $DigitalID = "DigitalProductId" $wmi = [WMIClass]"\$Targetrootdefault:stdRegProv" registry value $Object = $wmi.GetBinaryValue($hklm,$regPath,$DigitalID) [Array]$DigitalIDvalue = $Object.uValue get successed If($DigitalIDvalue) { producnt name and product ID $ProductName = (Get-itemproperty -Path "HKLM:SoftwareMicrosoftWindows NTCurrentVersion" -Name "ProductName").ProductName $ProductID = (Get-itemproperty -Path "HKLM:SoftwareMicrosoftWindows NTCurrentVersion" -Name "ProductId").ProductId binary value to serial number $Result = ConvertTokey $DigitalIDvalue $OSInfo = (Get-WmiObject "Win32_OperatingSystem" | select Caption).Caption If($OSInfo -match "Windows 10") { if($Result) { [string]$value ="ProductName : $ProductName `r`n" ` + "ProductID : $ProductID `r`n" ` + "Installed Key: $Result" $value Windows info to a file $Choice = GetChoice If( $Choice -eq 0 ) { $txtpath = "C:Users"+$env:USERNAME+"Desktop" New-Item -Path $txtpath -Name "WindowsKeyInfo.txt" -Value $value -ItemType File -Force | Out-Null } Elseif($Choice -eq 1) { Exit } } Else { Write-Warning "Запускайте скрипт в Windows 10" } } Else { Write-Warning...

0/0


0/0

0/0

0/0

0/0