Advertisement
TranTrung2006

Windows 7 Activator

Aug 8th, 2019
2,211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 3.73 KB | None | 0 0
  1. @echo off
  2. cd /d "%~dp0" && ( if exist "%temp%\getadmin.vbs" del "%temp%\getadmin.vbs" ) && fsutil dirty query %systemdrive% 1>nul 2>nul || (  cmd /u /c echo Set UAC = CreateObject^("Shell.Application"^) : UAC.ShellExecute "cmd.exe", "/k cd ""%~sdp0"" && ""%~s0""", "", "runas", 1 >> "%temp%\getadmin.vbs" && "%temp%\getadmin.vbs" && exit /B )
  3. title Windows 7 Activator License Tool. Copyright (C) 2019 TVT
  4. set spp=SoftwareLicensingProduct
  5. set sps=SoftwareLicensingService
  6. call :Color_Pre
  7. :detect
  8. echo Detecting Windows 7 Edition...
  9. echo.
  10. for /f "tokens=2 delims==" %%a in ('"wmic path %spp% where (ApplicationID='55c92734-d682-4d71-983e-d6ec3f16059f') get ID /value"') do (
  11. ::Starter
  12. echo %%a | find "9dee7406-49c2-43f2-b479-09bc4d5c4399">nul && (set "key=XD64C-JR7R6-MVJFK-9CTWP-VBR24"
  13. set "edition=Starter"
  14. goto activate)
  15. ::Home Basic
  16. echo %%a | find "25a0d760-2580-4c99-adfb-d57ba93560f5">nul && (set "key=FB9V4-98V76-2YWTR-7M2MP-86BYW"
  17. set "edition=Home Basic"
  18. goto activate)
  19. ::Home Pre
  20. echo %%a | find "5e017a8a-f3f9-4167-b1bd-ba3e236a4d8f">nul && (set "key=73Y9R-7WP78-PBXWQ-6KWGC-RD4T6"
  21. set "edition=Home Premium"
  22. goto activate)
  23. ::Pro
  24. echo %%a | find "c1e88de3-96c4-4563-ad7d-775f65b1e670">nul && (set "key=8YPY9-TJTT7-RWKHK-3QW2W-D79TG"
  25. set edition=Professional
  26. goto activate)
  27. ::Ultimate
  28. echo %%a | find "a0cde89c-3304-4157-b61c-c8ad785d1fad">nul && (set "key=PRG2C-6MTQ2-RPFKB-QFJRR-CDM36"
  29. set "edition=Ultimate"
  30. goto activate)
  31. )
  32. echo.
  33. echo Un-supported! Press any key to exit
  34. pause>nul
  35. exit
  36.  
  37. :activate
  38. call :color 2F "Detected edition Windows 7 %edition%"
  39. echo.
  40. echo Installing product key...
  41. wmic path %sps% where (Version is not null) call InstallProductKey ProductKey='%key%'>nul 2>&1
  42. if %errorlevel%==0 (call :color 2F "Successful"
  43. ) ELSE (call :color 4F "Error")
  44. echo Getting Installation ID (IID)
  45. for /f "tokens=2 delims==" %%a in ('"wmic path %spp% where (ApplicationID='55c92734-d682-4d71-983e-d6ec3f16059f' and OfflineInstallationId is not null) get OfflineInstallationId /value"') do set "IID=%%a">nul
  46. echo Installation ID (IID) = %IID%
  47. echo Getting Confrimation ID (CID)
  48. call :Get_CID %IID%
  49. echo Depositing Confimation ID...
  50. echo on
  51. wmic path SoftwareLicensingProduct where (OfflineInstallationId='%IID%') call DepositOfflineConfirmationId InstallationID='%IID%' ConfirmationId='%CID%'>nul 2>&1
  52. if %errorlevel%==0 (call :color 2F "Successful"
  53. ) ELSE (call :color 4F "Error")
  54. echo.
  55. echo Done! Press any key to continue...
  56. pause>nul
  57. exit
  58.  
  59. :: ======================================================
  60. ::  Multicolor outputs without any external programs
  61. ::  https://stackoverflow.com/a/5344911
  62. ::  Written by @jeb (stackoverflow)
  63. :: ======================================================
  64. :color
  65. pushd "%temp%"
  66. <nul set /p ".=%DEL%" > "%~2" &findstr /v /a:%1 /R "^$" "%~2" nul &del "%~2" > nul 2>&1 &popd &exit /b
  67.  
  68. :Color_Pre
  69. 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
  70.  
  71. :: ======================================================
  72. ::  Confrimation ID API by webact.truonghuynhit.com.
  73. ::  Thanks to TruongHuynhIT :)
  74. :: ======================================================
  75. :Get_CID
  76. 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
  77. set /p CID=<%temp%\CID.txt
  78. REM del %temp%\CID.txt
  79. exit /b
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement