Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- title Activate Microsoft Office Professional Plus 2021
- (cd /d "%~dp0")&&(NET FILE||(powershell -nop start-process -FilePath '%0' -verb runas)&(NET FILE||exit /B)) >nul 2>&1
- cls
- if exist "%ProgramFiles%\Microsoft Office\Office16\ospp.vbs" cd /d "%ProgramFiles%\Microsoft Office\Office16"
- ::if exist "%ProgramFiles(x86)%\Microsoft Office\Office16\ospp.vbs" cd /d "%ProgramFiles(x86)%\Microsoft Office\Office16"
- echo %CD% | find /I "Microsoft Office\Office16" >nul
- if NOT %ERRORLEVEL% EQU 0 echo Error! Office not found. & echo. & pause & exit /B
- (cscript //nologo ospp.vbs /dstatus | find /I "LICENSED" && goto licensed) >nul 2>&1
- for /f %%x in ('dir /b ..\root\Licenses16\ProPlus2021VL_KMS*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x"
- :continue
- REG ADD "HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\16.0\Common\Internet" /v "UseOnlineContent" /t REG_DWORD /d "0" /f
- REG ADD "HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\16.0\Common\SignIn" /v "SignInOptions" /t REG_DWORD /d "3" /f
- REG ADD "HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\16.0\Common\Privacy" /v "DisconnectedState" /t REG_DWORD /d "2" /f
- REG ADD "HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\16.0\Common\Privacy" /v "UserContentDisabled" /t REG_DWORD /d "2" /f
- REG ADD "HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\16.0\Common\Privacy" /v "DownloadContentDisabled" /t REG_DWORD /d "2" /f
- REG ADD "HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\16.0\Common\Privacy" /v "ControllerConnectedServicesEnabled" /t REG_DWORD /d "2" /f
- REG ADD "HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\Common\ClientTelemetry" /v "SendTelemetry" /t REG_DWORD /d "3" /f
- cscript //nologo ospp.vbs /ckms-domain
- cscript //nologo ospp.vbs /remhst
- cscript //nologo ospp.vbs /unpkey:PG343
- cscript //nologo ospp.vbs /unpkey:6F7TH
- cscript //nologo ospp.vbs /sethst:kms.digiboy.ir
- cscript //nologo ospp.vbs /setprt:1688
- cscript //nologo ospp.vbs /inpkey:FXYTK-NJJ8C-GB6DW-3DYQT-6F7TH
- cscript //nologo ospp.vbs /act
- cscript //nologo ospp.vbs /dstatus
- echo.
- pause
- exit /B
- :licensed
- cscript //nologo ospp.vbs /dstatus
- echo.
- echo Office appears to be already activated.
- echo.
- CHOICE /C YN /N /M "Are you sure you want to continue (Y/N)?"
- if %ERRORLEVEL% EQU 1 goto continue
- exit /B
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement