https://gist.github.com/mndambuki/bf3b6a1de33dd84dc4f59dcf8e111618
From the above link you will get below codes .bat version.
Run the below commands as per instructions.
1. Open powershell ise with admin privilege and paste the below powershell script commands:
Write-Host "Activating Microsoft Office 2019..."
# Office installation path detection
if (Test-Path "C:\Program Files\Microsoft Office\Office16\ospp.vbs") {
cd "C:\Program Files\Microsoft Office\Office16"
} elseif (Test-Path "C:\Program Files (x86)\Microsoft Office\Office16\ospp.vbs") {
cd "C:\Program Files (x86)\Microsoft Office\Office16"
} else {
Write-Host "Office installation not found."
exit
}
# Remove previous KMS configuration
cmd.exe /c "cscript //nologo slmgr.vbs /ckms"
cmd.exe /c "cscript //nologo ospp.vbs /setprt:1688"
cmd.exe /c "cscript //nologo ospp.vbs /unpkey:6MWKP"
# Enter new product key
cmd.exe /c "cscript //nologo ospp.vbs /inpkey:NMMKJ-6RK4F-KMJVX-8D9MJ-6MWKP"
# Set KMS server and attempt activation
$kmsServers = @("kms.03k.org", "kms8.msguides.com", "kms.digiboy.ir")
foreach ($server in $kmsServers) {
cmd.exe /c "cscript //nologo ospp.vbs /sethst:$server"
Start-Sleep -Seconds 3
$activationResult = cmd.exe /c "cscript //nologo ospp.vbs /act"
if ($activationResult -match "successful") {
Write-Host "Office activation successful!"
break
} else {
Write-Host "Failed to connect to $server. Trying next..."
}
}
Write-Host "Activation process complete."
Comments
Post a Comment