#Windows Activation
if((cscript "$env:SystemRoot\system32\slmgr.vbs"
-dli all)
-match "License
Status: Licensed")
{
{
}
else
{
else
{
Write-Output
"Activating Windows..."
cscript
"$env:SystemRoot\system32\slmgr.vbs" -ipk
XXXXX-XXXXX-XXXXX-XXXXX-XXXXx //nologo
cscript
"$env:SystemRoot\system32\slmgr.vbs" -ato
//nologo
}
2 comments:
This works better if you use -contains or -notcontains in the conditional statement, rather than -match.
This is beautiful. Thanks.
Post a Comment