我正在尝试用PowerShell激活Windows10。
我得到了以下脚本:
$computerName = $env:COMPUTERNAME
$key = "[Windows 10 product key is in here]"
$activationService = Get-WmiObject -Query "select * from SoftwareLicensingService" -ComputerName $computerName
$activationService.InstallProductKey($key)
$activationService.RefreshLicenseStatus()但我一直收到以下异常:
Exception calling "InstallProductKey" : ""
At F:test.ps1:4:1
+ $activationService.InstallProductKey($key)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : WMIMethodException我看起来就是搞不懂。
发布于 2018-01-11 21:31:07
语法是正确的!我使用以下命令激活了我的笔记本
$computer = gc env:computername
$key = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX"
$service = get-wmiObject -query "select * from SoftwareLicensingService" -computername $computer
$service.InstallProductKey($key)
$service.RefreshLicenseStatus()发布于 2019-04-11 05:44:49
以管理员身份启动cmd并运行:
slmgr.vbs /ipk xxxxx-xxxxx-xxxxx-xxxxx-xxxxxhttps://stackoverflow.com/questions/48208029
复制相似问题