Advertisement
TranTrung2006

Office/Visio/Project 2010 Retail Activator

Aug 8th, 2019
1,166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 4.31 KB | None | 0 0
  1. @echo off
  2. :: ======================================================================
  3. ::  Office/Visio/Project 2010 Retail Activator
  4. ::  Copyright (C) 2019 TVT
  5. ::  Tool use wmic method. Thanks to Duy Phuc by the instruction of wmic
  6. :: ======================================================================
  7. set ospp=OfficeSoftwareProtectionProduct
  8. set osps=OfficeSoftwareProtectionService
  9. set o14App=59a52881-a989-479d-af46-f275c6370663
  10. set o14ProPlusRRetailID=71af7e84-93e6-4363-9b69-699e04e74071
  11. set o14StandardRetailID=b6d2565c-341d-4768-ad7d-addbe00bb5ce
  12. set v14ProRetailID=d0a97e12-08a1-4a45-add5-1155b204e766
  13. set p14ProRetailID=47a5840c-8124-4a1f-a447-50168cd6833d
  14. call :Color_Pre
  15. :detect
  16. echo Detecting Office/Visio/Project 2010 Retail Product...
  17. for /f "tokens=2 delims==" %%a in ('"wmic path %ospp% where (ID='%o14ProPlusRRetailID%') get Name /value"') do set "o14ProPlusR=%%a"
  18. for /f "tokens=2 delims==" %%a in ('"wmic path %ospp% where (ID='%o14StandardRetailID%') get Name /value"') do set "o14StandardR=%%a"
  19. for /f "tokens=2 delims==" %%a in ('"wmic path %ospp% where (ID='%v14ProRetailID%') get Name /value"') do set "v14ProR=%%a"
  20. for /f "tokens=2 delims==" %%a in ('"wmic path %ospp% where (ID='%p14ProRetailID%') get Name /value"') do set "p14ProR=%%a"
  21. if defined o14ProPlusR (set support=1&set name=%o14ProPlusR%&call :activate %o14ProPlusRRetailID% 7PXYK-9CXTF-6JHGT-XDM4W-2TGR8)
  22. if defined o14StandardR (set support=1&set name=%o14StandardR%&call :activate %o14StandardRetailID% Q8G9G-29G9K-BPG72-HRJXH-8MXBV)
  23. if defined v14ProR (set support=1&set name=%v14ProR%&call :activate %v14ProRetailID% 72RMM-CM272-QJVJR-J3PXG-M3X73)
  24. if defined p14ProR (set support=1&set name=%p14ProR%&call :activate %p14ProRetailID% D3RJ6-TC66B-CXKGJ-3MFXD-VRY3X)
  25. if not defined support (goto unsupport)
  26. echo.
  27. echo Done! Press any key to exit
  28. pause>nul
  29. exit
  30.  
  31. :activate
  32. call :color 2F "Detected %name%"
  33. echo.
  34. echo Installing Product key...
  35. wmic path %osps% where (Version is not null) call InstallProductKey ProductKey='%2'>nul 2>&1
  36. if %errorlevel% == 0 (call :color 2F "Product key installed successful") ELSE (call :color 4F "Error")
  37. echo.
  38. echo Getting Installation ID (IID)
  39. for /f "tokens=2 delims==" %%a in ('"wmic path %ospp% where (ID='%1') get OfflineInstallationId /value"') do set "IID=%%a">nul 2>&1
  40. echo Getting Confirmation ID (CID)...
  41. call :Get_CID %IID%
  42. echo Depositng CID...
  43. wmic path %ospp% where (OfflineInstallationId='%IID%') call DepositOfflineConfirmationId InstallationId='%IID%' ConfirmationId='%CID%'>nul 2>&1
  44. if %errorlevel% == 0 (call :color 2F "Confirmation ID Deposited successful") ELSE (call :color 4F "Error")
  45. echo.
  46. echo Activating your product...
  47. wmic path %ospp% where (ID='%1') call Activate>nul 2>&1
  48. if %errorlevel% == 0 (call :color 2F "Product actiavted successful") ELSE (call :color 4F "Error")
  49. echo.
  50. exit /b
  51.  
  52. :unsupport
  53. call :color 4F "Did not detect any Office/Visio/Project 2010 Retail product on this computer"
  54. echo.
  55. echo This tool only support that Office product
  56. echo.
  57. echo Press any key to exit...
  58. pause>nul
  59. exit
  60.  
  61. :: ======================================================
  62. ::  Multicolor outputs without any external programs
  63. ::  https://stackoverflow.com/a/5344911
  64. ::  Written by @jeb (stackoverflow)
  65. :: ======================================================
  66. :color
  67. pushd "%temp%"
  68. <nul set /p ".=%DEL%" > "%~2" &findstr /v /a:%1 /R "^$" "%~2" nul &del "%~2" > nul 2>&1 &popd &exit /b
  69.  
  70. :Color_Pre
  71. 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
  72.  
  73. :: ======================================================
  74. ::  Confrimation ID API by webact.truonghuynhit.com
  75. ::  Thanks to TruongHuynhIT :)
  76. :: ======================================================
  77. :Get_CID
  78. 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
  79. set /p CID=<%temp%\CID.txt&del %temp%\CID.txt
  80. exit /b
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement