Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- :: ======================================================================
- :: Office/Visio/Project 2010 Retail Activator
- :: Copyright (C) 2019 TVT
- :: Tool use wmic method. Thanks to Duy Phuc by the instruction of wmic
- :: ======================================================================
- set ospp=OfficeSoftwareProtectionProduct
- set osps=OfficeSoftwareProtectionService
- set o14App=59a52881-a989-479d-af46-f275c6370663
- set o14ProPlusRRetailID=71af7e84-93e6-4363-9b69-699e04e74071
- set o14StandardRetailID=b6d2565c-341d-4768-ad7d-addbe00bb5ce
- set v14ProRetailID=d0a97e12-08a1-4a45-add5-1155b204e766
- set p14ProRetailID=47a5840c-8124-4a1f-a447-50168cd6833d
- call :Color_Pre
- :detect
- echo Detecting Office/Visio/Project 2010 Retail Product...
- for /f "tokens=2 delims==" %%a in ('"wmic path %ospp% where (ID='%o14ProPlusRRetailID%') get Name /value"') do set "o14ProPlusR=%%a"
- for /f "tokens=2 delims==" %%a in ('"wmic path %ospp% where (ID='%o14StandardRetailID%') get Name /value"') do set "o14StandardR=%%a"
- for /f "tokens=2 delims==" %%a in ('"wmic path %ospp% where (ID='%v14ProRetailID%') get Name /value"') do set "v14ProR=%%a"
- for /f "tokens=2 delims==" %%a in ('"wmic path %ospp% where (ID='%p14ProRetailID%') get Name /value"') do set "p14ProR=%%a"
- if defined o14ProPlusR (set support=1&set name=%o14ProPlusR%&call :activate %o14ProPlusRRetailID% 7PXYK-9CXTF-6JHGT-XDM4W-2TGR8)
- if defined o14StandardR (set support=1&set name=%o14StandardR%&call :activate %o14StandardRetailID% Q8G9G-29G9K-BPG72-HRJXH-8MXBV)
- if defined v14ProR (set support=1&set name=%v14ProR%&call :activate %v14ProRetailID% 72RMM-CM272-QJVJR-J3PXG-M3X73)
- if defined p14ProR (set support=1&set name=%p14ProR%&call :activate %p14ProRetailID% D3RJ6-TC66B-CXKGJ-3MFXD-VRY3X)
- if not defined support (goto unsupport)
- echo.
- echo Done! Press any key to exit
- pause>nul
- exit
- :activate
- call :color 2F "Detected %name%"
- echo.
- echo Installing Product key...
- wmic path %osps% where (Version is not null) call InstallProductKey ProductKey='%2'>nul 2>&1
- if %errorlevel% == 0 (call :color 2F "Product key installed successful") ELSE (call :color 4F "Error")
- echo.
- echo Getting Installation ID (IID)
- for /f "tokens=2 delims==" %%a in ('"wmic path %ospp% where (ID='%1') get OfflineInstallationId /value"') do set "IID=%%a">nul 2>&1
- echo Getting Confirmation ID (CID)...
- call :Get_CID %IID%
- echo Depositng CID...
- wmic path %ospp% where (OfflineInstallationId='%IID%') call DepositOfflineConfirmationId InstallationId='%IID%' ConfirmationId='%CID%'>nul 2>&1
- if %errorlevel% == 0 (call :color 2F "Confirmation ID Deposited successful") ELSE (call :color 4F "Error")
- echo.
- echo Activating your product...
- wmic path %ospp% where (ID='%1') call Activate>nul 2>&1
- if %errorlevel% == 0 (call :color 2F "Product actiavted successful") ELSE (call :color 4F "Error")
- echo.
- exit /b
- :unsupport
- call :color 4F "Did not detect any Office/Visio/Project 2010 Retail product on this computer"
- echo.
- echo This tool only support that Office product
- echo.
- echo Press any key to exit...
- pause>nul
- exit
- :: ======================================================
- :: Multicolor outputs without any external programs
- :: https://stackoverflow.com/a/5344911
- :: Written by @jeb (stackoverflow)
- :: ======================================================
- :color
- pushd "%temp%"
- <nul set /p ".=%DEL%" > "%~2" &findstr /v /a:%1 /R "^$" "%~2" nul &del "%~2" > nul 2>&1 &popd &exit /b
- :Color_Pre
- for /F "tokens=1,2 delims=#" %%a in ('"prompt #$H#$E# & echo on & for %%b in (1) do rem"') do (set "DEL=%%a") &exit /b
- :: ======================================================
- :: Confrimation ID API by webact.truonghuynhit.com
- :: Thanks to TruongHuynhIT :)
- :: ======================================================
- :Get_CID
- powershell -Command "function ConvertFrom-Json20([parameter(ValueFromPipeline = $true)][object] $item) { add-type -assembly system.web.extensions; $ps_js = new-object system.web.script.serialization.javascriptSerializer; return , $ps_js.DeserializeObject($item);};$wc = New-Object System.Net.WebClient; $wc.Headers.Add('User-Agent', 'Get CID (PoSh version) [Developed by TruongHuynhIT]');$json = $wc.DownloadString('https://webact.truonghuynhit.com/GetCID/?IID=%1') | ConvertFrom-Json20;$json.data.CID;">%temp%\CID.txt
- set /p CID=<%temp%\CID.txt&del %temp%\CID.txt
- exit /b
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement