Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- 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 )
- title Windows 7 Activator License Tool. Copyright (C) 2019 TVT
- set spp=SoftwareLicensingProduct
- set sps=SoftwareLicensingService
- call :Color_Pre
- :detect
- echo Detecting Windows 7 Edition...
- echo.
- for /f "tokens=2 delims==" %%a in ('"wmic path %spp% where (ApplicationID='55c92734-d682-4d71-983e-d6ec3f16059f') get ID /value"') do (
- ::Starter
- echo %%a | find "9dee7406-49c2-43f2-b479-09bc4d5c4399">nul && (set "key=XD64C-JR7R6-MVJFK-9CTWP-VBR24"
- set "edition=Starter"
- goto activate)
- ::Home Basic
- echo %%a | find "25a0d760-2580-4c99-adfb-d57ba93560f5">nul && (set "key=FB9V4-98V76-2YWTR-7M2MP-86BYW"
- set "edition=Home Basic"
- goto activate)
- ::Home Pre
- echo %%a | find "5e017a8a-f3f9-4167-b1bd-ba3e236a4d8f">nul && (set "key=73Y9R-7WP78-PBXWQ-6KWGC-RD4T6"
- set "edition=Home Premium"
- goto activate)
- ::Pro
- echo %%a | find "c1e88de3-96c4-4563-ad7d-775f65b1e670">nul && (set "key=8YPY9-TJTT7-RWKHK-3QW2W-D79TG"
- set edition=Professional
- goto activate)
- ::Ultimate
- echo %%a | find "a0cde89c-3304-4157-b61c-c8ad785d1fad">nul && (set "key=PRG2C-6MTQ2-RPFKB-QFJRR-CDM36"
- set "edition=Ultimate"
- goto activate)
- )
- echo.
- echo Un-supported! Press any key to exit
- pause>nul
- exit
- :activate
- call :color 2F "Detected edition Windows 7 %edition%"
- echo.
- echo Installing product key...
- wmic path %sps% where (Version is not null) call InstallProductKey ProductKey='%key%'>nul 2>&1
- if %errorlevel%==0 (call :color 2F "Successful"
- ) ELSE (call :color 4F "Error")
- echo Getting Installation ID (IID)
- 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
- echo Installation ID (IID) = %IID%
- echo Getting Confrimation ID (CID)
- call :Get_CID %IID%
- echo Depositing Confimation ID...
- echo on
- wmic path SoftwareLicensingProduct where (OfflineInstallationId='%IID%') call DepositOfflineConfirmationId InstallationID='%IID%' ConfirmationId='%CID%'>nul 2>&1
- if %errorlevel%==0 (call :color 2F "Successful"
- ) ELSE (call :color 4F "Error")
- echo.
- echo Done! Press any key to continue...
- 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
- REM del %temp%\CID.txt
- exit /b
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement