├── Add-Store ├── Add-Store.cmd ├── Microsoft.DesktopAppInstaller_2022.127.2322.0_neutral___8wekyb3d8bbwe.Msixbundle ├── Microsoft.NET.Native.Framework.2.2_2.2.29512.0_x64__8wekyb3d8bbwe.Appx ├── Microsoft.NET.Native.Framework.2.2_2.2.29512.0_x86__8wekyb3d8bbwe.Appx ├── Microsoft.NET.Native.Runtime.2.2_2.2.28604.0_x64__8wekyb3d8bbwe.Appx ├── Microsoft.NET.Native.Runtime.2.2_2.2.28604.0_x86__8wekyb3d8bbwe.Appx ├── Microsoft.UI.Xaml.2.7_7.2203.17001.0_x64__8wekyb3d8bbwe.Appx ├── Microsoft.UI.Xaml.2.7_7.2203.17001.0_x86__8wekyb3d8bbwe.Appx ├── Microsoft.VCLibs.140.00.UWPDesktop_14.0.30704.0_x64__8wekyb3d8bbwe.Appx ├── Microsoft.VCLibs.140.00.UWPDesktop_14.0.30704.0_x86__8wekyb3d8bbwe.Appx ├── Microsoft.VCLibs.140.00_14.0.30704.0_x64__8wekyb3d8bbwe.Appx ├── Microsoft.VCLibs.140.00_14.0.30704.0_x86__8wekyb3d8bbwe.Appx └── Microsoft.WindowsStore_22204.1401.3.0_neutral___8wekyb3d8bbwe.Msixbundle ├── Fix-LTSC2021 ├── Fix-LTSC2021.cmd ├── Microsoft.VCLibs.140.00_14.0.30704.0_x64__8wekyb3d8bbwe.Appx └── Microsoft.VCLibs.140.00_14.0.30704.0_x86__8wekyb3d8bbwe.Appx ├── HWID-KMS38_Activation ├── BIN │ ├── gatherosstate.exe │ └── slc.dll └── HWID_Activation.cmd ├── README.md ├── README.txt ├── RunThis.cmd └── Winactivate ├── LICENSE ├── README.md ├── gatherosstate.exe ├── slc.dll ├── winactivate.cmd └── winactivate.ps1 /Add-Store/Add-Store.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | openfiles 1>nul 2>nul || goto :administrator 3 | if /i "%PROCESSOR_ARCHITECTURE%" equ "AMD64" (set "arch=x64") else (set "arch=x86") 4 | set "install=PowerShell -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Bypass add-appxpackage" 5 | if /i %arch%==x64 (goto :x64) else (goto :x86) 6 | goto :error 7 | :x64 8 | echo. 9 | echo Microsoft.NET.Native.Framework x64 installing... 10 | for /f %%i in ('dir /s/b %~dp0*NET.Native.Framework*x64*') do %install% %%i && echo Microsoft.NET.Native.Framework x64 installing finished 11 | echo. 12 | echo Microsoft.NET.Native.Runtime x64 installing... 13 | for /f %%i in ('dir /s/b %~dp0*NET.Native.Runtime*x64*') do %install% %%i && echo Microsoft.NET.Native.Runtime x64 installing finished 14 | echo. 15 | echo Microsoft.UI.Xaml x64 installing... 16 | for /f %%i in ('dir /s/b %~dp0*UI.Xaml*x64*') do %install% %%i && echo Microsoft.UI.Xaml x64 installing finished 17 | for /f "tokens=2-3 delims=." %%G in ('PowerShell get-appxpackage *vclib*') do if %%G==VCLibs (goto :skipVCLibsx64) 18 | echo. 19 | echo Microsoft.VCLibs x64 installing... 20 | for /f %%i in ('dir /s/b %~dp0*VCLibs*x64*') do %install% %%i && echo Microsoft.VCLibs x64 installing finished 21 | :skipVCLibsx64 22 | for /f "tokens=2-3 delims=." %%G in ('PowerShell get-appxpackage *vclib*UWP*') do if %%G==VCLibs (goto :skipVCLibsUWPx64) 23 | echo. 24 | echo Microsoft.VCLibs UWP x64 installing... 25 | for /f %%i in ('dir /s/b %~dp0*VCLibs*UWP*x64*') do %install% %%i && echo Microsoft.VCLibs UWP x64 installing finished 26 | :skipVCLibsUWPx64 27 | echo. 28 | echo Microsoft.WindowsStore installing... 29 | for /f %%i in ('dir /s/b %~dp0*WindowsStore*') do %install% %%i && echo Microsoft.WindowsStore installing finished 30 | echo. 31 | echo DesktopAppInstaller x64 installing... 32 | for /f %%i in ('dir /s/b %~dp0*DesktopAppInstaller*') do %install% %%i && echo DesktopAppInstaller x64 installing finished 33 | goto :finished 34 | :x86 35 | echo. 36 | echo Microsoft.NET.Native.Framework x86 installing... 37 | for /f %%i in ('dir /s/b %~dp0*NET.Native.Framework*x86*') do %install% %%i && echo Microsoft.NET.Native.Framework x86 installing finished 38 | echo. 39 | echo Microsoft.NET.Native.Runtime x86 installing... 40 | for /f %%i in ('dir /s/b %~dp0*NET.Native.Runtime*x86*') do %install% %%i && echo Microsoft.NET.Native.Runtime x86 installing finished 41 | echo. 42 | echo Microsoft.UI.Xaml x86 installing... 43 | for /f %%i in ('dir /s/b %~dp0*UI.Xaml*x86*') do %install% %%i && echo Microsoft.UI.Xaml x86 installing finished 44 | for /f "tokens=2-3 delims=." %%G in ('PowerShell get-appxpackage *vclib*') do if %%G==VCLibs (goto :skipVCLibsx86) 45 | echo. 46 | echo Microsoft.VCLibs x86 installing... 47 | for /f %%i in ('dir /s/b %~dp0*VCLibs*x86*') do %install% %%i && echo Microsoft.VCLibs x86 installing finished 48 | :skipVCLibsx86 49 | for /f "tokens=2-3 delims=." %%G in ('PowerShell get-appxpackage *vclib*UWP*') do if %%G==VCLibs (goto :skipVCLibsUWPx86) 50 | echo. 51 | echo Microsoft.VCLibs UWP x86 installing... 52 | for /f %%i in ('dir /s/b %~dp0*VCLibs*UWP*x86*') do %install% %%i && echo Microsoft.VCLibs UWP x86 installing finished 53 | :skipVCLibsUWPx86 54 | echo. 55 | echo Microsoft.WindowsStore installing... 56 | for /f %%i in ('dir /s/b %~dp0*WindowsStore*') do %install% %%i && echo Microsoft.WindowsStore installing finished 57 | echo. 58 | echo DesktopAppInstaller installing... 59 | for /f %%i in ('dir /s/b %~dp0*DesktopAppInstaller*') do %install% %%i && echo DesktopAppInstaller installing finished 60 | 61 | :administrator 62 | echo. 63 | echo Please run this by administrator privilege. 64 | echo. 65 | goto :finished 66 | :error 67 | echo error: Can not detect system arch. 68 | goto :finished 69 | :finished 70 | echo. 71 | echo Press any key... 72 | pause >nul -------------------------------------------------------------------------------- /Add-Store/Microsoft.DesktopAppInstaller_2022.127.2322.0_neutral___8wekyb3d8bbwe.Msixbundle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brokyz/Win10_LTSC_2021_FixPacks/f5c72570930fabd4528abd911e93bf2c6c0fd18d/Add-Store/Microsoft.DesktopAppInstaller_2022.127.2322.0_neutral___8wekyb3d8bbwe.Msixbundle -------------------------------------------------------------------------------- /Add-Store/Microsoft.NET.Native.Framework.2.2_2.2.29512.0_x64__8wekyb3d8bbwe.Appx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brokyz/Win10_LTSC_2021_FixPacks/f5c72570930fabd4528abd911e93bf2c6c0fd18d/Add-Store/Microsoft.NET.Native.Framework.2.2_2.2.29512.0_x64__8wekyb3d8bbwe.Appx -------------------------------------------------------------------------------- /Add-Store/Microsoft.NET.Native.Framework.2.2_2.2.29512.0_x86__8wekyb3d8bbwe.Appx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brokyz/Win10_LTSC_2021_FixPacks/f5c72570930fabd4528abd911e93bf2c6c0fd18d/Add-Store/Microsoft.NET.Native.Framework.2.2_2.2.29512.0_x86__8wekyb3d8bbwe.Appx -------------------------------------------------------------------------------- /Add-Store/Microsoft.NET.Native.Runtime.2.2_2.2.28604.0_x64__8wekyb3d8bbwe.Appx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brokyz/Win10_LTSC_2021_FixPacks/f5c72570930fabd4528abd911e93bf2c6c0fd18d/Add-Store/Microsoft.NET.Native.Runtime.2.2_2.2.28604.0_x64__8wekyb3d8bbwe.Appx -------------------------------------------------------------------------------- /Add-Store/Microsoft.NET.Native.Runtime.2.2_2.2.28604.0_x86__8wekyb3d8bbwe.Appx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brokyz/Win10_LTSC_2021_FixPacks/f5c72570930fabd4528abd911e93bf2c6c0fd18d/Add-Store/Microsoft.NET.Native.Runtime.2.2_2.2.28604.0_x86__8wekyb3d8bbwe.Appx -------------------------------------------------------------------------------- /Add-Store/Microsoft.UI.Xaml.2.7_7.2203.17001.0_x64__8wekyb3d8bbwe.Appx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brokyz/Win10_LTSC_2021_FixPacks/f5c72570930fabd4528abd911e93bf2c6c0fd18d/Add-Store/Microsoft.UI.Xaml.2.7_7.2203.17001.0_x64__8wekyb3d8bbwe.Appx -------------------------------------------------------------------------------- /Add-Store/Microsoft.UI.Xaml.2.7_7.2203.17001.0_x86__8wekyb3d8bbwe.Appx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brokyz/Win10_LTSC_2021_FixPacks/f5c72570930fabd4528abd911e93bf2c6c0fd18d/Add-Store/Microsoft.UI.Xaml.2.7_7.2203.17001.0_x86__8wekyb3d8bbwe.Appx -------------------------------------------------------------------------------- /Add-Store/Microsoft.VCLibs.140.00.UWPDesktop_14.0.30704.0_x64__8wekyb3d8bbwe.Appx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brokyz/Win10_LTSC_2021_FixPacks/f5c72570930fabd4528abd911e93bf2c6c0fd18d/Add-Store/Microsoft.VCLibs.140.00.UWPDesktop_14.0.30704.0_x64__8wekyb3d8bbwe.Appx -------------------------------------------------------------------------------- /Add-Store/Microsoft.VCLibs.140.00.UWPDesktop_14.0.30704.0_x86__8wekyb3d8bbwe.Appx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brokyz/Win10_LTSC_2021_FixPacks/f5c72570930fabd4528abd911e93bf2c6c0fd18d/Add-Store/Microsoft.VCLibs.140.00.UWPDesktop_14.0.30704.0_x86__8wekyb3d8bbwe.Appx -------------------------------------------------------------------------------- /Add-Store/Microsoft.VCLibs.140.00_14.0.30704.0_x64__8wekyb3d8bbwe.Appx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brokyz/Win10_LTSC_2021_FixPacks/f5c72570930fabd4528abd911e93bf2c6c0fd18d/Add-Store/Microsoft.VCLibs.140.00_14.0.30704.0_x64__8wekyb3d8bbwe.Appx -------------------------------------------------------------------------------- /Add-Store/Microsoft.VCLibs.140.00_14.0.30704.0_x86__8wekyb3d8bbwe.Appx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brokyz/Win10_LTSC_2021_FixPacks/f5c72570930fabd4528abd911e93bf2c6c0fd18d/Add-Store/Microsoft.VCLibs.140.00_14.0.30704.0_x86__8wekyb3d8bbwe.Appx -------------------------------------------------------------------------------- /Add-Store/Microsoft.WindowsStore_22204.1401.3.0_neutral___8wekyb3d8bbwe.Msixbundle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brokyz/Win10_LTSC_2021_FixPacks/f5c72570930fabd4528abd911e93bf2c6c0fd18d/Add-Store/Microsoft.WindowsStore_22204.1401.3.0_neutral___8wekyb3d8bbwe.Msixbundle -------------------------------------------------------------------------------- /Fix-LTSC2021/Fix-LTSC2021.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | openfiles 1>nul 2>nul || goto :administrator 3 | if /i "%PROCESSOR_ARCHITECTURE%" equ "AMD64" (set "arch=x64") else (set "arch=x86") 4 | set "install=PowerShell -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Bypass add-appxpackage" 5 | if /i %arch%==x64 (goto :x64) else (goto :x86) 6 | goto :error 7 | :x64 8 | for /f "tokens=2-3 delims=." %%G in ('PowerShell get-appxpackage *vclib*') do if %%G==VCLibs (goto :exist) 9 | echo Microsoft.VCLibs x64 installing... 10 | for /f %%i in ('dir /s/b %~dp0*VCLibs*x64*') do %install% %%i && echo Microsoft.VCLibs x64 installing finished. 11 | goto :finished 12 | :x86 13 | for /f "tokens=2-3 delims=." %%G in ('PowerShell get-appxpackage *vclib*') do if %%G==VCLibs (goto :exist) 14 | echo Microsoft.VCLibs x86 installing... 15 | for /f %%i in ('dir /s/b %~dp0*VCLibs*x86*') do %install% %%i && echo Microsoft.VCLibs x86 installing finished. 16 | goto :finished 17 | 18 | :administrator 19 | echo. 20 | echo Please run this by administrator privilege. 21 | echo. 22 | goto :finished 23 | 24 | :exist 25 | echo. 26 | echo Microsoft.VCLibs has already installed in your system. 27 | echo Open PowerShell and run command "get-appxpackage *VCLibs*" to view. 28 | echo. 29 | goto :finished 30 | 31 | :finished 32 | echo. 33 | echo Press any key... 34 | pause >nul 35 | 36 | 37 | -------------------------------------------------------------------------------- /Fix-LTSC2021/Microsoft.VCLibs.140.00_14.0.30704.0_x64__8wekyb3d8bbwe.Appx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brokyz/Win10_LTSC_2021_FixPacks/f5c72570930fabd4528abd911e93bf2c6c0fd18d/Fix-LTSC2021/Microsoft.VCLibs.140.00_14.0.30704.0_x64__8wekyb3d8bbwe.Appx -------------------------------------------------------------------------------- /Fix-LTSC2021/Microsoft.VCLibs.140.00_14.0.30704.0_x86__8wekyb3d8bbwe.Appx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brokyz/Win10_LTSC_2021_FixPacks/f5c72570930fabd4528abd911e93bf2c6c0fd18d/Fix-LTSC2021/Microsoft.VCLibs.140.00_14.0.30704.0_x86__8wekyb3d8bbwe.Appx -------------------------------------------------------------------------------- /HWID-KMS38_Activation/BIN/gatherosstate.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brokyz/Win10_LTSC_2021_FixPacks/f5c72570930fabd4528abd911e93bf2c6c0fd18d/HWID-KMS38_Activation/BIN/gatherosstate.exe -------------------------------------------------------------------------------- /HWID-KMS38_Activation/BIN/slc.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brokyz/Win10_LTSC_2021_FixPacks/f5c72570930fabd4528abd911e93bf2c6c0fd18d/HWID-KMS38_Activation/BIN/slc.dll -------------------------------------------------------------------------------- /HWID-KMS38_Activation/HWID_Activation.cmd: -------------------------------------------------------------------------------- 1 | @setlocal DisableDelayedExpansion 2 | @echo off 3 | 4 | 5 | 6 | ::============================================================================ 7 | :: 8 | :: This script is a part of 'Microsoft Activation Scripts' (MAS) project. 9 | :: 10 | :: Homepage: windowsaddict.ml 11 | :: Email: windowsaddict@protonmail.com 12 | :: 13 | ::============================================================================ 14 | 15 | 16 | 17 | :: To activate with Downlevel method (default), run the script with /a parameter or change 0 to 1 in below line 18 | set _acti=0 19 | 20 | :: To only generate GenuineTicket.xml with Downlevel method (default), run the script with /g parameter or change 0 to 1 in below line 21 | set _gent=0 22 | 23 | :: To enable LockBox method, run the script with /k parameter or change 0 to 1 in below line 24 | :: You need to use this option with either activation or ticket generation. 25 | :: Example, 26 | :: HWID_Activation.cmd /a /k 27 | :: HWID_Activation.cmd /g /k 28 | set _lock=0 29 | 30 | 31 | 32 | :: If value is changed in above lines or any parameter is used then script will run in unattended mode 33 | :: Incase if more than one options are used then only one option will be applied 34 | 35 | 36 | 37 | ::======================================================================================================================================== 38 | 39 | :: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows 40 | :: or with ARM64 process if it was initiated by x86/ARM32 process on ARM64 Windows 41 | 42 | if exist %SystemRoot%\Sysnative\cmd.exe ( 43 | set "_cmdf=%~f0" 44 | setlocal EnableDelayedExpansion 45 | start %SystemRoot%\Sysnative\cmd.exe /c ""!_cmdf!" %*" 46 | exit /b 47 | ) 48 | 49 | :: Re-launch the script with ARM32 process if it was initiated by x64 process on ARM64 Windows 50 | 51 | if exist %SystemRoot%\SysArm32\cmd.exe if %PROCESSOR_ARCHITECTURE%==AMD64 ( 52 | set "_cmdf=%~f0" 53 | setlocal EnableDelayedExpansion 54 | start %SystemRoot%\SysArm32\cmd.exe /c ""!_cmdf!" %*" 55 | exit /b 56 | ) 57 | 58 | :: Set Path variable, it helps if it is misconfigured in the system 59 | 60 | set "SysPath=%SystemRoot%\System32" 61 | if exist "%SystemRoot%\Sysnative\reg.exe" (set "SysPath=%SystemRoot%\Sysnative") 62 | set "Path=%SysPath%;%SystemRoot%;%SysPath%\Wbem;%SysPath%\WindowsPowerShell\v1.0\" 63 | 64 | ::======================================================================================================================================== 65 | 66 | cls 67 | color 07 68 | title HWID Activation 69 | 70 | set _args= 71 | set _elev= 72 | set _unattended=0 73 | 74 | set _args=%* 75 | if defined _args set _args=%_args:"=% 76 | if defined _args ( 77 | for %%A in (%_args%) do ( 78 | if /i "%%A"=="/a" set _acti=1 79 | if /i "%%A"=="/g" set _gent=1 80 | if /i "%%A"=="/k" set _lock=1 81 | if /i "%%A"=="-el" set _elev=1 82 | ) 83 | ) 84 | 85 | for %%A in (%_acti% %_gent% %_lock%) do (if "%%A"=="1" set _unattended=1) 86 | 87 | ::======================================================================================================================================== 88 | 89 | set winbuild=1 90 | set "nul=>nul 2>&1" 91 | set "_psc=%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" 92 | for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G 93 | 94 | set _NCS=1 95 | if %winbuild% LSS 10586 set _NCS=0 96 | if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 2>nul | find /i "0x0" 1>nul && (set _NCS=0) 97 | 98 | if %_NCS% EQU 1 ( 99 | for /F %%a in ('echo prompt $E ^| cmd') do set "esc=%%a" 100 | set "Red="41;97m"" 101 | set "Gray="100;97m"" 102 | set "Green="42;97m"" 103 | set "Magenta="45;97m"" 104 | set "_White="40;37m"" 105 | set "_Green="40;92m"" 106 | set "_Yellow="40;93m"" 107 | ) else ( 108 | set "Red="Red" "white"" 109 | set "Gray="Darkgray" "white"" 110 | set "Green="DarkGreen" "white"" 111 | set "Magenta="Darkmagenta" "white"" 112 | set "_White="Black" "Gray"" 113 | set "_Green="Black" "Green"" 114 | set "_Yellow="Black" "Yellow"" 115 | ) 116 | 117 | set "nceline=echo: &echo ==== ERROR ==== &echo:" 118 | set "eline=echo: &call :dk_color %Red% "==== ERROR ====" &echo:" 119 | set slp=SoftwareLicensingProduct 120 | set sls=SoftwareLicensingService 121 | set wApp=55c92734-d682-4d71-983e-d6ec3f16059f 122 | if %~z0 GEQ 1500000 (set "_exitmsg=Go back") else (set "_exitmsg=Exit") 123 | set "notifytocheckupdate=if %winbuild% GTR 19044 echo Make sure you are using updated version of the script." 124 | 125 | ::======================================================================================================================================== 126 | 127 | if %winbuild% LSS 10240 ( 128 | %eline% 129 | echo Unsupported OS version detected. 130 | echo Project is supported for Windows 10/11. 131 | goto dk_done 132 | ) 133 | 134 | if %winbuild% GEQ 22483 if not exist %_psc% ( 135 | %nceline% 136 | echo Powershell is not installed in the system. 137 | goto dk_done 138 | ) 139 | 140 | ::======================================================================================================================================== 141 | 142 | :: Fix for the special characters limitation in path name 143 | 144 | set "_work=%~dp0" 145 | if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%" 146 | 147 | set "_batf=%~f0" 148 | set "_batp=%_batf:'=''%" 149 | 150 | set "_PSarg="""%~f0""" -el %_args%" 151 | 152 | set "_ttemp=%temp%" 153 | 154 | setlocal EnableDelayedExpansion 155 | 156 | ::======================================================================================================================================== 157 | 158 | echo "!_batf!" | find /i "!_ttemp!" 1>nul && ( 159 | %eline% 160 | echo Script is launched from the temp folder, 161 | echo Most likely you are running the script directly from the archive file. 162 | echo: 163 | echo Extract the archive file and launch the script from the extracted folder. 164 | goto dk_done 165 | ) 166 | 167 | ::======================================================================================================================================== 168 | 169 | :: Elevate script as admin and pass arguments and preventing loop 170 | 171 | %nul% reg query HKU\S-1-5-19 || ( 172 | if not defined _elev %nul% %_psc% "start cmd.exe -arg '/c \"!_PSarg:'=''!\"' -verb runas" && exit /b 173 | %eline% 174 | echo This script require administrator privileges. 175 | echo To do so, right click on this script and select 'Run as administrator'. 176 | goto dk_done 177 | ) 178 | 179 | ::======================================================================================================================================== 180 | 181 | :dl_menu 182 | 183 | if %_unattended%==0 ( 184 | cls 185 | mode 76, 25 186 | title HWID Activation 187 | 188 | if !_lock!==0 (set "_method=%_Green% "[Downlevel Method]"") else (set "_method=%_Yellow% " [LockBox Method]"") 189 | echo: 190 | echo: 191 | echo: 192 | echo ____________________________________________________________ 193 | echo: 194 | call :dk_color2 %_White% " [1] HWID Activation " !_method! 195 | echo ____________________________________________ 196 | echo: 197 | call :dk_color2 %_White% " [2] Generate Ticket " !_method! 198 | echo ____________________________________________ 199 | echo: 200 | echo [3] Change Method 201 | echo: 202 | echo [4] %_exitmsg% 203 | echo ____________________________________________________________ 204 | echo: 205 | call :dk_color2 %_White% " " %_Green% "Enter a menu option in the Keyboard [1,2,3,4]" 206 | choice /C:1234 /N 207 | set _el=!errorlevel! 208 | if !_el!==4 exit /b 209 | if !_el!==3 ( 210 | if !_lock!==0 ( 211 | set _lock=1 212 | ) else ( 213 | set _lock=0 214 | ) 215 | cls 216 | echo: 217 | call :dk_color %_Green% " Downlevel Method:" 218 | echo It creates downlevelGTkey ticket for activation with simplest process. 219 | echo: 220 | call :dk_color %_Yellow% " LockBox Method:" 221 | echo It creates clientLockboxKey ticket which better mimics genuine activation, 222 | echo But requires more steps such as, 223 | echo - Cleaning ClipSVC licences 224 | echo - Deleting a volatile and protected registry key by taking ownership_lock 225 | echo - System may need a restart for succesfull activation 226 | echo - Microsoft Account and Store Apps may need relogin-restart in the system 227 | echo: 228 | call :dk_color2 %_White% " " %Green% "Note:" 229 | echo Microsoft accepts both types of tickets and that's unlikely to change. 230 | echo If you are not sure what to choose then select default Downlevel Method. 231 | echo: 232 | call :dk_color %_Yellow% " Press any key to go back..." 233 | pause >nul 234 | goto :dl_menu 235 | ) 236 | if !_el!==2 set _gent=1&goto :dl_menu2 237 | if !_el!==1 goto :dl_menu2 238 | goto :dl_menu 239 | ) 240 | 241 | :dl_menu2 242 | 243 | cls 244 | if %_gent%==1 (set _title=title Generate HWID GenuineTicket.xml) else (set _title=title HWID Activation) 245 | if %_lock%==0 (%_title% [Downlevel Method] & mode 102, 30) else (%_title% [Lockbox Method] & mode 102, 32) 246 | 247 | ::======================================================================================================================================== 248 | 249 | if not exist %_psc% if %_lock%==1 ( 250 | set _lock=0 251 | set _gent=0 252 | %nceline% 253 | echo Powershell is not installed in the system. 254 | echo It is required for Lockbox Method of HWID. 255 | echo You need to set the script to the default. 256 | if %_unattended%==0 ( 257 | echo: 258 | call :dk_color %_Yellow% "Press any key to go back..." 259 | pause >nul 260 | goto dl_menu 261 | ) else ( 262 | goto dk_done 263 | ) 264 | ) 265 | 266 | if %_gent%==1 if exist %Systemdrive%\GenuineTicket.xml ( 267 | set _gent=0 268 | %eline% 269 | echo File '%Systemdrive%\GenuineTicket.xml' already exist. 270 | if %_unattended%==0 ( 271 | echo: 272 | call :dk_color %_Yellow% "Press any key to go back..." 273 | pause >nul 274 | goto dl_menu 275 | ) else ( 276 | goto dk_done 277 | ) 278 | ) 279 | 280 | ::======================================================================================================================================== 281 | 282 | echo: 283 | echo Initializing... 284 | 285 | :: Check WMI and sppsvc Errors 286 | 287 | set applist= 288 | net start sppsvc /y %nul% 289 | if %winbuild% LSS 22483 set "chkapp=for /f "tokens=2 delims==" %%a in ('"wmic path %slp% where (ApplicationID='%wApp%') get ID /VALUE" 2^>nul')" 290 | if %winbuild% GEQ 22483 set "chkapp=for /f "tokens=2 delims==" %%a in ('%_psc% "(([WMISEARCHER]'SELECT ID FROM %slp% WHERE ApplicationID=''%wApp%''').Get()).ID ^| %% {echo ('ID='+$_)}" 2^>nul')" 291 | %chkapp% do (if defined applist (call set "applist=!applist! %%a") else (call set "applist=%%a")) 292 | 293 | if not defined applist ( 294 | %eline% 295 | echo Failed running WMI query check, verify that these services are working correctly 296 | echo Windows Management Instrumentation [WinMgmt], Software Protection [sppsvc] 297 | echo: 298 | echo Script will try to enable these services. 299 | echo: 300 | if %_unattended%==0 ( 301 | call :dk_color %_Yellow% "Press any key to continue..." 302 | pause >nul 303 | ) 304 | for /f "skip=2 tokens=2*" %%a in ('reg query HKLM\SYSTEM\CurrentControlSet\Services\WinMgmt /v Start 2^>nul') do if /i %%b equ 0x4 (sc config WinMgmt start= auto %nul%) 305 | net start WinMgmt /y %nul% 306 | net stop sppsvc /y %nul% 307 | net start sppsvc /y %nul% 308 | cls 309 | ) 310 | 311 | ::======================================================================================================================================== 312 | 313 | :: Refresh license status, it helps to get correct product name in Windows 17134 and later builds 314 | 315 | call :dk_refresh 316 | 317 | :: Check product name 318 | 319 | set winos= 320 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName 2^>nul') do set "winos=%%b" 321 | 322 | ::======================================================================================================================================== 323 | 324 | :: Check if system is permanently activated or not 325 | 326 | cls 327 | call :dk_checkperm 328 | if defined _perm if not %_gent%==1 ( 329 | echo ___________________________________________________________________________________________ 330 | echo: 331 | call :dk_color2 %_White% " " %Green% "Checking: %winos% is Permanently Activated." 332 | call :dk_color2 %_White% " " %Gray% "Activation is not required." 333 | echo ___________________________________________________________________________________________ 334 | if %_unattended%==1 goto dk_done 335 | echo: 336 | choice /C:12 /N /M "> [1] Activate [2] %_exitmsg% : " 337 | if errorlevel 2 exit /b 338 | ) 339 | cls 340 | 341 | ::======================================================================================================================================== 342 | 343 | :: Check Evaluation version 344 | 345 | set _eval= 346 | set _evalserv= 347 | if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*EvalEdition~*.mum" set _eval=1 348 | if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*EvalEdition~*.mum" set _evalserv=1 349 | if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*EvalCorEdition~*.mum" set _eval=1 & set _evalserv=1 350 | 351 | if defined _eval ( 352 | %eline% 353 | echo [%winos% ^| %winbuild%] 354 | if defined _evalserv ( 355 | echo Server Evaluation cannot be activated. Convert it to full Server OS. 356 | ) else ( 357 | echo Evaluation Editions cannot be activated. Install full Windows OS. 358 | echo Check the ReadMe for how to get genuine installation media for full version. 359 | ) 360 | goto dk_done 361 | ) 362 | 363 | ::======================================================================================================================================== 364 | 365 | :: Check SKU value 366 | 367 | set osSKU= 368 | for /f "tokens=3 delims=." %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\ProductOptions" /v OSProductPfn 2^>nul') do set "osSKU=%%a" 369 | 370 | if not defined osSKU ( 371 | %eline% 372 | echo SKU value was not detected properly. Aborting... 373 | goto dk_done 374 | ) 375 | 376 | ::======================================================================================================================================== 377 | 378 | :: Check if HWID key (Retail,OEM,MAK) is already installed or not 379 | 380 | set _hwidk= 381 | call :dk_channel 382 | for %%A in (Retail,OEM,MAK) do echo: %_channel%| findstr /i "%%A" >nul && set _hwidk=1 383 | 384 | ::======================================================================================================================================== 385 | 386 | :: Detect Key 387 | 388 | set key= 389 | set notworking= 390 | set actidnotfound= 391 | 392 | if defined applist call :hwiddata attempt1 393 | if not defined key call :hwiddata attempt2 394 | 395 | ::======================================================================================================================================== 396 | 397 | if not defined key if not defined _hwidk ( 398 | %eline% 399 | echo [%winos% ^| %winbuild% ^| SKU:%osSKU%] 400 | echo Unable to find this product in the supported product list. 401 | %notifytocheckupdate% 402 | echo: 403 | echo However, if you would like to try HWID activation on this product then, 404 | echo install any generic Retail, OEM, MAK key for this product and run the script. 405 | goto dk_done 406 | ) 407 | 408 | if not defined key ( 409 | echo: 410 | call :dk_color %Magenta% "====== Info ======" 411 | echo: 412 | echo [%winos% ^| %winbuild% ^| SKU:%osSKU%] 413 | echo Unable to find this product in the supported product list. 414 | %notifytocheckupdate% 415 | echo: 416 | echo Since %_channel% key is already installed, script will try to activate with HWID. 417 | echo: 418 | echo It may or may not activate it. 419 | if %_unattended%==0 ( 420 | echo: 421 | call :dk_color %_Yellow% "Press any key to continue..." 422 | pause >nul 423 | ) 424 | cls 425 | ) 426 | 427 | ::======================================================================================================================================== 428 | 429 | :: Enterprise LTSC 2021 doesn't support HWID (At the time of writing this). 430 | :: To activate it with HWID, script insert the product key of Iot Enterprise LTSC 2021. Restart is required for full effect. 431 | 432 | :: If you don't want to change it then comment/delete the below lines. 433 | 434 | set changekey= 435 | if /i %key%==KCNVH-YKWX8-GJJB9-H9FDT-6F7W2 ( 436 | set _chan=OEM:NONSLP 437 | set changekey=1 438 | set notworking= 439 | set key=QPM6N-7J2WJ-P88HH-P3YRH-YY74H 440 | ) 441 | 442 | ::======================================================================================================================================== 443 | 444 | :: Check and show info for editions which doesn't support HWID now but may support it in future 445 | 446 | if defined notworking ( 447 | echo: 448 | call :dk_color %Magenta% "====== Info ======" 449 | echo: 450 | echo [%winos% ^| %winbuild% ^| SKU:%osSKU%] 451 | echo At the time of writing this, HWID Activation was not supported for this product. 452 | echo: 453 | echo Now it may or may not activate it. 454 | if %_unattended%==0 ( 455 | echo: 456 | call :dk_color %_Yellow% "Press any key to continue..." 457 | pause >nul 458 | ) 459 | cls 460 | ) 461 | 462 | ::======================================================================================================================================== 463 | 464 | :: Check Windows Architecture 465 | 466 | set arch= 467 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v PROCESSOR_ARCHITECTURE') do set arch=%%b 468 | 469 | if not defined arch ( 470 | %eline% 471 | echo Unable to detect Windows Architecture. Aborting... 472 | goto dk_done 473 | ) 474 | 475 | ::======================================================================================================================================== 476 | 477 | :: Check files 478 | 479 | set ARM64_file= 480 | if /i "%arch%"=="ARM64" set ARM64_file=arm64_ 481 | 482 | for %%# in (%ARM64_file%gatherosstate.exe %ARM64_file%slc.dll) do ( 483 | if not exist "!_work!\BIN\%%#" ( 484 | %eline% 485 | echo '%%#' file is missing in 'BIN' folder. Aborting... 486 | goto dk_done 487 | ) 488 | ) 489 | 490 | :: Verify gatherosstate.exe file 491 | 492 | set _hash= 493 | if /i "%arch%"=="ARM64" (set _orig=7E449AE5549A0D93CF65F4A1BB2AA7D1DC090D2D) else (set _orig=FABB5A0FC1E6A372219711152291339AF36ED0B5) 494 | for /f "skip=1 tokens=* delims=" %%# in ('certutil -hashfile "!_work!\BIN\%ARM64_file%gatherosstate.exe" SHA1^|findstr /i /v CertUtil') do set "_hash=%%#" 495 | set "_hash=%_hash: =%" 496 | 497 | if /i not "%_hash%"=="%_orig%" ( 498 | %eline% 499 | echo %ARM64_file%gatherosstate.exe SHA1 hash mismatch found. 500 | echo: 501 | echo Expected: %_orig% 502 | echo Detected: %_hash% 503 | goto dk_done 504 | ) 505 | 506 | ::======================================================================================================================================== 507 | 508 | :: Check Internet connection 509 | 510 | cls 511 | echo: 512 | echo Checking OS Info [%winos% ^| %winbuild% ^| %arch%] 513 | 514 | if not %_gent%==1 ( 515 | set _intcon= 516 | ping -n 1 dns.msftncsi.com 2>nul | find "131.107.255.255" 1>nul || ping -n 1 www.microsoft.com 1>nul 517 | if !errorlevel!==0 ( 518 | set _intcon=1 519 | echo Checking Internet Connection [Connected] 520 | ) else ( 521 | call :dk_color %Red% "Checking Internet Connection [Not connected]" 522 | ) 523 | ) 524 | 525 | ::======================================================================================================================================== 526 | 527 | echo: 528 | set "_serv=ClipSVC wlidsvc sppsvc LicenseManager Winmgmt wuauserv" 529 | 530 | :: Client License Service (ClipSVC) 531 | :: Microsoft Account Sign-in Assistant 532 | :: Software Protection 533 | :: Windows License Manager Service 534 | :: Windows Management Instrumentation 535 | :: Windows Update 536 | 537 | echo Checking Services [%_serv%] 538 | 539 | :: Check disabled services 540 | 541 | set serv_ste= 542 | for %%# in (%_serv%) do ( 543 | set serv_dis= 544 | reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v Start %nul% || set serv_dis=1 545 | for /f "skip=2 tokens=2*" %%a in ('reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v Start 2^>nul') do if /i %%b equ 0x4 set serv_dis=1 546 | if defined serv_dis (if defined serv_ste (set "serv_ste=!serv_ste! %%#") else (set "serv_ste=%%#")) 547 | ) 548 | 549 | :: Change disabled services startup type to auto 550 | 551 | set serv_csts= 552 | set serv_cste= 553 | 554 | if defined serv_ste ( 555 | for %%# in (%serv_ste%) do ( 556 | sc config %%# start= auto %nul% && ( 557 | if defined serv_csts (set "serv_csts=!serv_csts! %%#") else (set "serv_csts=%%#") 558 | ) || ( 559 | if defined serv_cste (set "serv_cste=!serv_cste! %%#") else (set "serv_cste=%%#") 560 | ) 561 | ) 562 | ) 563 | 564 | if defined serv_csts echo Enabling Disabled Services [Successful] [%serv_csts%] 565 | if defined serv_cste call :dk_color %Red% "Enabling Disabled Services [Failed] [%serv_cste%]" 566 | 567 | ::======================================================================================================================================== 568 | 569 | :: Check if the services are able to run or not 570 | 571 | set serv_e= 572 | for %%# in (%_serv%) do ( 573 | sc query %%# | find /i "RUNNING" %nul% || net start %%# /y %nul% 574 | sc query %%# | find /i "RUNNING" %nul% || sc start %%# %nul% 575 | sc query %%# | find /i "RUNNING" %nul% || if defined serv_e (set "serv_e=!serv_e! %%#") else (set "serv_e=%%#") 576 | ) 577 | 578 | if not defined serv_e ( 579 | echo Starting Services [Successful] 580 | ) else ( 581 | call :dk_color %Red% "Starting Services [Failed] [%serv_e%]" 582 | echo %serv_e% | find /i "wuauserv" %nul% && ( 583 | call :dk_color %Magenta% "Windows Update Service [wuauserv] is not working, check if you have blocked it" 584 | ) 585 | ) 586 | 587 | if not defined applist ( 588 | call :dk_color %Red% "Checking WMI Query [Failed]" 589 | ) else ( 590 | echo Checking WMI Query [Successful] 591 | ) 592 | 593 | ::======================================================================================================================================== 594 | 595 | :: Install key 596 | 597 | echo: 598 | if defined changekey call :dk_color %Magenta% "Windows 10 Iot Enterprise LTSC 2021 Product Key Is Selected For HWID Activation"&echo: 599 | 600 | set _partial= 601 | if defined key set _ipartial=%key:~-5% 602 | 603 | if %winbuild% LSS 22483 for /f "tokens=2 delims==" %%# in ('wmic path %slp% where "ApplicationID='%wApp%' and PartialProductKey<>null" Get PartialProductKey /value 2^>nul') do set "_partial=%%#" 604 | if %winbuild% GEQ 22483 for /f "tokens=2 delims==" %%# in ('%_psc% "(([WMISEARCHER]'SELECT PartialProductKey FROM %slp% WHERE ApplicationID=''%wApp%'' AND PartialProductKey IS NOT NULL').Get()).PartialProductKey | %% {echo ('PartialProductKey='+$_)}" 2^>nul') do set "_partial=%%#" 605 | 606 | if defined key if /i "%_partial%"=="%_ipartial%" ( 607 | echo Checking Installed Product Key [%key%] [%_channel%] 608 | ) 609 | 610 | if not defined key ( 611 | echo Checking Installed Product Key [Partial Key - %_partial%] [%_channel%] 612 | ) 613 | 614 | set _channel= 615 | if defined key if /i not "%_partial%"=="%_ipartial%" ( 616 | if %winbuild% LSS 22483 wmic path %sls% where __CLASS='%sls%' call InstallProductKey ProductKey="%key%" %nul% 617 | if %winbuild% GEQ 22483 %_psc% "(([WMISEARCHER]'SELECT Version FROM %sls%').Get()).InstallProductKey('%key%')" %nul% 618 | if not !errorlevel!==0 cscript //nologo %windir%\system32\slmgr.vbs /ipk %key% %nul% 619 | 620 | if !errorlevel!==0 ( 621 | call :dk_refresh 622 | echo Installing Generic Product Key [%key%] [%_chan%] [Successful] 623 | ) else ( 624 | call :dk_color %Red% "Installing Generic Product Key [%key%] [%_chan%] [Failed]%actidnotfound%" 625 | ) 626 | ) 627 | 628 | ::======================================================================================================================================== 629 | 630 | :: Files are copied to temp to generate ticket to avoid possible issues in case the path contains special character or non English names 631 | 632 | echo: 633 | set "temp_=%SystemRoot%\Temp\_Temp" 634 | if exist "%temp_%\.*" rmdir /s /q "%temp_%\" %nul% 635 | md "%temp_%\" %nul% 636 | 637 | pushd "!_work!\BIN\" 638 | copy /y /b "%ARM64_file%gatherosstate.exe" "%temp_%\gatherosstate.exe" %nul% 639 | copy /y /b "%ARM64_file%slc.dll" "%temp_%\slc.dll" %nul% 640 | popd 641 | 642 | set copyf= 643 | if not exist "%temp_%\gatherosstate.exe" set copyf=1 644 | if not exist "%temp_%\slc.dll" set copyf=1 645 | 646 | if defined copyf ( 647 | call :dk_color %Red% "Copying Required Files to Temp [%temp_%] [Failed]" 648 | goto :dl_final 649 | ) else ( 650 | echo Copying Required Files to Temp [%temp_%] [Successful] 651 | ) 652 | 653 | ::======================================================================================================================================== 654 | 655 | :: Modify the Pfn value in gatherosstate with slc.dll as per the system, that way one gatherosstate can be used in all the editions 656 | 657 | pushd "%temp_%\" 658 | rundll32 "%temp_%\slc.dll",PatchGatherosstate %nul% 659 | popd 660 | if not exist "%temp_%\gatherosstatemodified.exe" ( 661 | call :dk_color %Red% "Creating Modified Gatherosstate [Failed] Aborting..." 662 | call :dk_color %Magenta% "Most likely Antivirus blocked the process, disable it and/or create proper exclsuions" 663 | goto :dl_final 664 | ) else ( 665 | echo Creating Modified Gatherosstate [Successful] 666 | ) 667 | 668 | ::======================================================================================================================================== 669 | 670 | :: Clean ClipSVC Licences 671 | :: This code runs only if Lockbox method to generate ticket is manually set by the user in this script. 672 | 673 | if %_lock%==1 ( 674 | for %%# in (ClipSVC) do ( 675 | sc query %%# | find /i "STOPPED" %nul% || net stop %%# /y %nul% 676 | sc query %%# | find /i "STOPPED" %nul% || sc stop %%# %nul% 677 | ) 678 | 679 | rundll32 clipc.dll,ClipCleanUpState 680 | 681 | if exist "%ProgramData%\Microsoft\Windows\ClipSVC\*.dat" del /f /q "%ProgramData%\Microsoft\Windows\ClipSVC\*.dat" %nul% 682 | 683 | if exist "%ProgramData%\Microsoft\Windows\ClipSVC\tokens.dat" ( 684 | call :dk_color %Red% "Cleaning ClipSVC Licences [Failed]" 685 | ) else ( 686 | echo Cleaning ClipSVC Licences [Successful] 687 | ) 688 | ) 689 | 690 | ::======================================================================================================================================== 691 | 692 | :: Below registry key (Volatile & Protected) gets created after the ClipSVC License cleanup command, and gets automatically deleted after 693 | :: system restart. It needs to be deleted to activate the system without restart. 694 | 695 | :: This code runs only if Lockbox method to generate ticket is manually set by the user in this script. 696 | 697 | set "RegKey=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ClipSVC\Volatile\PersistedSystemState" 698 | 699 | if %_lock%==1 ( 700 | call :regown "%RegKey%" %nul% 701 | reg delete "%RegKey%" /f %nul% 702 | 703 | reg query "%RegKey%" %nul% && ( 704 | call :dk_color %Red% "Deleting a Volatile Registry [Failed]" 705 | call :dk_color %Magenta% "Restart the system, that will delete this registry key automatically" 706 | ) || ( 707 | echo Deleting a Volatile Registry [Successful] 708 | ) 709 | ) 710 | 711 | ::======================================================================================================================================== 712 | 713 | :: Multiple attempts to generate the ticket because in some cases, one attempt is not enough. 714 | 715 | echo: 716 | set "_noxml=if not exist "%temp_%\GenuineTicket.xml"" 717 | 718 | start /wait "" "%temp_%/gatherosstatemodified.exe" %nul% 719 | %_noxml% timeout /t 3 %nul% 720 | %_noxml% net stop sppsvc /y %nul% 721 | %_noxml% call "%temp_%/gatherosstatemodified.exe" %nul% 722 | %_noxml% timeout /t 3 %nul% 723 | %_noxml% "%temp_%/gatherosstatemodified.exe" %nul% 724 | %_noxml% timeout /t 3 %nul% 725 | 726 | :: Refresh ClipSVC (required after cleanup) with below command, not related to generating tickets 727 | 728 | if %_lock%==1 ( 729 | for %%# in (wlidsvc LicenseManager sppsvc) do (net stop %%# /y %nul% & net start %%# /y %nul%) 730 | call :dk_refresh 731 | ) 732 | 733 | %_noxml% ( 734 | call :dk_color %Red% "Generating GenuineTicket.xml [Failed] Aborting..." 735 | goto :dl_final 736 | ) 737 | 738 | if %_lock%==1 ( 739 | find /i "clientLockboxKey" "%temp_%\GenuineTicket.xml" >nul && ( 740 | echo Generating GenuineTicket.xml [Successful] [clientLockboxKey Ticket] 741 | ) || ( 742 | call :dk_color %Red% "Generating GenuineTicket.xml [Failed] [downlevelGTkey Ticket created] Aborting..." 743 | call :dk_color %Magenta% "Try again / Restart system" 744 | goto :dl_final 745 | ) 746 | ) else ( 747 | echo Generating GenuineTicket.xml [Successful] 748 | ) 749 | 750 | ::======================================================================================================================================== 751 | 752 | :: Copy GenuineTicket.xml to the root of C drive and exit if ticket generation option was used in script 753 | 754 | if %_gent%==1 ( 755 | echo: 756 | copy /y /b "%temp_%\GenuineTicket.xml" "%Systemdrive%\GenuineTicket.xml" %nul% 757 | if not exist "%Systemdrive%\GenuineTicket.xml" ( 758 | call :dk_color %Red% "Copying GenuineTicket.xml to %Systemdrive%\ [Failed]" 759 | ) else ( 760 | call :dk_color %Green% "Copying GenuineTicket.xml to %Systemdrive%\ [Successful]" 761 | ) 762 | goto :dl_final 763 | ) 764 | 765 | ::======================================================================================================================================== 766 | 767 | :: clipup -v -o -altto method to apply ticket is not used to avoid the certain issues in case if the username have 768 | :: spaces / special characters / non English names 769 | 770 | set "tdir=%ProgramData%\Microsoft\Windows\ClipSVC\GenuineTicket" 771 | if exist "%tdir%\*.xml" del /f /q "%tdir%\*.xml" %nul% 772 | copy /y /b "%temp_%\GenuineTicket.xml" "%tdir%\GenuineTicket.xml" %nul% 773 | 774 | if not exist "%tdir%\GenuineTicket.xml" ( 775 | call :dk_color %Red% "Failed to copy Ticket to [%ProgramData%\Microsoft\Windows\ClipSVC\GenuineTicket\]" 776 | goto :dl_final 777 | ) 778 | 779 | set "_xmlexist=if exist "%tdir%\GenuineTicket.xml"" 780 | 781 | net stop ClipSVC /y %nul% 782 | net start ClipSVC /y %nul% 783 | %_xmlexist% timeout /t 2 %nul% 784 | %_xmlexist% timeout /t 2 %nul% 785 | 786 | %_xmlexist% %_psc% Restart-Service ClipSVC %nul% 787 | %_xmlexist% timeout /t 2 %nul% 788 | %_xmlexist% timeout /t 2 %nul% 789 | 790 | set fallback_= 791 | %_xmlexist% ( 792 | set fallback_=1 793 | %nul% clipup -v -o 794 | %_xmlexist% timeout /t 2 %nul% 795 | ) 796 | 797 | %_xmlexist% ( 798 | call :dk_color %Red% "Installing GenuineTicket.xml [Failed] Aborting..." 799 | if exist "%tdir%\*.xml" del /f /q "%tdir%\*.xml" %nul% 800 | goto :dl_final 801 | ) else ( 802 | if defined fallback_ (call :dk_color %Red% "Installing GenuineTicket.xml [Successful] [Fallback method: clipup -v -o]" 803 | ) else (echo Installing GenuineTicket.xml [Successful] 804 | ) 805 | ) 806 | 807 | ::========================================================================================================================================== 808 | 809 | if defined changekey ( 810 | set winos= 811 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName 2^>nul') do set "winos=%%b" 812 | ) 813 | 814 | echo: 815 | echo Activating... 816 | echo: 817 | 818 | call :dk_act 819 | call :dk_checkperm 820 | if defined _perm ( 821 | call :dk_color %Green% "%winos% is permanently activated." 822 | goto :dl_final 823 | ) 824 | 825 | :: Refresh some services and license status 826 | 827 | if %_lock%==1 set _retry=1 828 | if defined _intcon set _retry=1 829 | 830 | if defined _retry ( 831 | for %%# in (wlidsvc LicenseManager sppsvc) do (net stop %%# /y %nul% & net start %%# /y %nul%) 832 | call :dk_refresh 833 | call :dk_act 834 | cscript //nologo %windir%\system32\slmgr.vbs /ato %nul% 835 | ) 836 | 837 | :: Check license status reason with wmi query, activation command errorlevel gives incorrect result in older builds of Windows 10 838 | 839 | set _status=0 840 | if %winbuild% LSS 22483 for /f "tokens=2 delims==" %%a in ('"wmic path %slp% where (ApplicationID='%wApp%' and PartialProductKey is not null) get LicenseStatusReason /VALUE" 2^>nul') do set "_status=%%a" 841 | if %winbuild% GEQ 22483 for /f "tokens=2 delims==" %%a in ('%_psc% "(([WMISEARCHER]'SELECT LicenseStatusReason FROM %slp% WHERE ApplicationID=''%wApp%'' AND PartialProductKey IS NOT NULL').Get()).LicenseStatusReason | %% {echo ('LicenseStatusReason='+$_)}" 2^>nul') do set "_status=%%a" 842 | cmd /c exit /b %_status% 843 | 844 | if %_status% NEQ 0 set "error_code=[Error Code: 0x!=ExitCode!]" 845 | 846 | call :dk_checkperm 847 | 848 | if defined _perm ( 849 | call :dk_color %Green% "%winos% is permanently activated." 850 | ) else ( 851 | call :dk_color %Red% "Activation Failed %error_code%" 852 | call :dk_color %Magenta% "Try again / Restart system / Check troubleshooting steps in ReadMe" 853 | ) 854 | 855 | ::======================================================================================================================================== 856 | 857 | :dl_final 858 | 859 | echo: 860 | if exist "%temp_%\.*" rmdir /s /q "%temp_%\" %nul% 861 | if exist "%temp_%\" ( 862 | call :dk_color %Red% "Cleaning Temp Files [Failed]" 863 | ) else ( 864 | echo Cleaning Temp Files [Successful] 865 | ) 866 | 867 | :: Rolling back services startup type back to disabled 868 | 869 | set serv_rsts= 870 | set serv_rste= 871 | 872 | if defined serv_csts ( 873 | for %%# in (%serv_csts%) do ( 874 | sc config %%# start= disabled %nul% && ( 875 | if defined serv_rsts (set "serv_rsts=!serv_rsts! %%#") else (set "serv_rsts=%%#") 876 | ) || ( 877 | if defined serv_rste (set "serv_cste=!serv_rste! %%#") else (set "serv_rste=%%#") 878 | ) 879 | ) 880 | ) 881 | 882 | if defined serv_rsts echo Reverting Services Back To Disabled [Successful] [%serv_rsts%] 883 | if defined serv_rste call :dk_color %Red% "Reverting Services Back To Disabled [Failed] [%serv_rste%]" 884 | 885 | goto :dk_done 886 | 887 | ::======================================================================================================================================== 888 | 889 | :: A lean and mean snippet to set registry ownership and permission recursively 890 | :: Written by @AveYo aka @BAU 891 | :: pastebin.com/XTPt0JSC 892 | 893 | :: Modified by @abbodi1406 to make it work in ARM64 Windows 10 (builds older than 21277) where only x86 version of PowerShell is installed. 894 | 895 | :: This code runs only if Lockbox method is manually set by the user in this script. 896 | 897 | :regown 898 | 899 | %_psc% $A='%~1','%~2','%~3','%~4','%~5','%~6';iex(([io.file]::ReadAllText('!_batp!')-split':Own1\:.*')[1])&exit/b:Own1: 900 | $D1=[uri].module.gettype('System.Diagnostics.Process')."GetM`ethods"(42) |where {$_.Name -eq 'SetPrivilege'} #`:no-ev-warn 901 | 'SeSecurityPrivilege','SeTakeOwnershipPrivilege','SeBackupPrivilege','SeRestorePrivilege'|foreach {$D1.Invoke($null, @("$_",2))} 902 | $path=$A[0]; $rk=$path-split'\\',2; switch -regex ($rk[0]){'[mM]'{$hv=2147483650};'[uU]'{$hv=2147483649};default{$hv=2147483648};} 903 | $HK=[Microsoft.Win32.RegistryKey]::OpenBaseKey($hv, 256); $s=$A[1]; $sps=[Security.Principal.SecurityIdentifier] 904 | $u=($A[2],'S-1-5-32-544')[!$A[2]];$o=($A[3],$u)[!$A[3]];$w=$u,$o |% {new-object $sps($_)}; $old=!$A[3];$own=!$old; $y=$s-eq'all' 905 | $rar=new-object Security.AccessControl.RegistryAccessRule( $w[0], ($A[5],'FullControl')[!$A[5]], 1, 0, ($A[4],'Allow')[!$A[4]] ) 906 | $x=$s-eq'none';function Own1($k){$t=$HK.OpenSubKey($k,2,'TakeOwnership');if($t){0,4|%{try{$o=$t.GetAccessControl($_)}catch{$old=0} 907 | };if($old){$own=1;$w[1]=$o.GetOwner($sps)};$o.SetOwner($w[0]);$t.SetAccessControl($o); $c=$HK.OpenSubKey($k,2,'ChangePermissions') 908 | $p=$c.GetAccessControl(2);if($y){$p.SetAccessRuleProtection(1,1)};$p.ResetAccessRule($rar);if($x){$p.RemoveAccessRuleAll($rar)} 909 | $c.SetAccessControl($p);if($own){$o.SetOwner($w[1]);$t.SetAccessControl($o)};if($s){$($subkeys=$HK.OpenSubKey($k).GetSubKeyNames()) 2>$null; 910 | foreach($n in $subkeys){Own1 "$k\$n"}}}};Own1 $rk[1];if($env:VO){get-acl Registry::$path|fl} #:Own1: lean & mean snippet by AveYo 911 | 912 | ::======================================================================================================================================== 913 | 914 | :: Check Windows permanent activation status 915 | 916 | :dk_checkperm 917 | 918 | if %winbuild% LSS 22483 wmic path %slp% where (LicenseStatus='1' and GracePeriodRemaining='0' and PartialProductKey is not NULL) get Name /value 2>nul | findstr /i "Windows" 1>nul && set _perm=1||set _perm= 919 | if %winbuild% GEQ 22483 %_psc% "(([WMISEARCHER]'SELECT Name FROM %slp% WHERE LicenseStatus=1 AND GracePeriodRemaining=0 AND PartialProductKey IS NOT NULL').Get()).Name | %% {echo ('Name='+$_)}" 2>nul | findstr /i "Windows" 1>nul && set _perm=1||set _perm= 920 | exit /b 921 | 922 | :: Refresh license status 923 | 924 | :dk_refresh 925 | 926 | if %winbuild% LSS 22483 wmic path %sls% where __CLASS='%sls%' call RefreshLicenseStatus %nul% 927 | if %winbuild% GEQ 22483 %_psc% "$null=(([WMICLASS]'%sls%').GetInstances()).RefreshLicenseStatus()" %nul% 928 | exit /b 929 | 930 | :: Check Windows installed key channel 931 | 932 | :dk_channel 933 | 934 | if %winbuild% LSS 22483 for /f "tokens=2 delims==" %%# in ('wmic path %slp% where "ApplicationID='%wApp%' and PartialProductKey<>null" Get ProductKeyChannel /value 2^>nul') do set "_channel=%%#" 935 | if %winbuild% GEQ 22483 for /f "tokens=2 delims==" %%# in ('%_psc% "(([WMISEARCHER]'SELECT ProductKeyChannel FROM %slp% WHERE ApplicationID=''%wApp%'' AND PartialProductKey IS NOT NULL').Get()).ProductKeyChannel | %% {echo ('ProductKeyChannel='+$_)}" 2^>nul') do set "_channel=%%#" 936 | exit /b 937 | 938 | :: Activation command 939 | 940 | :dk_act 941 | 942 | if %winbuild% LSS 22483 wmic path %slp% where "ApplicationID='%wApp%' and PartialProductKey<>null" call Activate %nul% 943 | if %winbuild% GEQ 22483 %_psc% "(([WMISEARCHER]'SELECT ID FROM %slp% WHERE ApplicationID=''%wApp%'' AND PartialProductKey IS NOT NULL').Get()).Activate()" %nul% 944 | exit /b 945 | 946 | ::======================================================================================================================================== 947 | 948 | :dk_color 949 | 950 | if %_NCS% EQU 1 ( 951 | echo %esc%[%~1%~2%esc%[0m 952 | ) else ( 953 | if not exist %_psc% (echo %~3) else (%_psc% write-host -back '%1' -fore '%2' '%3') 954 | ) 955 | exit /b 956 | 957 | :dk_color2 958 | 959 | if %_NCS% EQU 1 ( 960 | echo %esc%[%~1%~2%esc%[%~3%~4%esc%[0m 961 | ) else ( 962 | if not exist %_psc% (echo %~3%~6) else (%_psc% write-host -back '%1' -fore '%2' '%3' -NoNewline; write-host -back '%4' -fore '%5' '%6') 963 | ) 964 | exit /b 965 | 966 | ::======================================================================================================================================== 967 | 968 | :dk_done 969 | 970 | echo: 971 | if %_unattended%==1 timeout /t 2 & exit /b 972 | call :dk_color %_Yellow% "Press any key to %_exitmsg%..." 973 | pause >nul 974 | exit /b 975 | 976 | ::======================================================================================================================================== 977 | 978 | :: 1st column = Activation ID 979 | :: 2nd column = Generic Retail/OEM/MAK Key 980 | :: 3rd column = SKU ID 981 | :: 4th column = 1 = activation is not working (at the time of writing this), 0 = activation is working 982 | :: 5th column = Key Type 983 | :: 6th column = WMI Edition ID 984 | :: 7th column = Version name incase same Edition ID is used in different OS versions with different key 985 | :: Separator = _ 986 | 987 | :: Key preference is in the following order. Retail > OEM:NONSLP > OEM:DM > Volume:MAK 988 | 989 | :hwiddata 990 | 991 | for %%# in ( 992 | 8b351c9c-f398-4515-9900-09df49427262_XGVPP-NMH47-7TTHJ-W3FW7-8HV2C___4_0_OEM:NONSLP_Enterprise 993 | 23505d51-32d6-41f0-8ca7-e78ad0f16e71_D6RD9-D4N8T-RT9QX-YW6YT-FCWWJ__11_1_____Retail_Starter 994 | c83cef07-6b72-4bbc-a28f-a00386872839_3V6Q6-NQXCX-V8YXR-9QCYV-QPFCT__27_0_Volume:MAK_EnterpriseN 995 | 211b80cc-7f64-482c-89e9-4ba21ff827ad_3NFXW-2T27M-2BDW6-4GHRV-68XRX__47_1_____Retail_StarterN 996 | 4de7cb65-cdf1-4de9-8ae8-e3cce27b9f2c_VK7JG-NPHTM-C97JM-9MPGT-3V66T__48_0_____Retail_Professional 997 | 9fbaf5d6-4d83-4422-870d-fdda6e5858aa_2B87N-8KFHP-DKV6R-Y2C8J-PKCKT__49_0_____Retail_ProfessionalN 998 | f742e4ff-909d-4fe9-aacb-3231d24a0c58_4CPRK-NM3K3-X6XXQ-RXX86-WXCHW__98_0_____Retail_CoreN 999 | 1d1bac85-7365-4fea-949a-96978ec91ae0_N2434-X9D7W-8PF6X-8DV9T-8TYMD__99_0_____Retail_CoreCountrySpecific 1000 | 3ae2cc14-ab2d-41f4-972f-5e20142771dc_BT79Q-G7N6G-PGBYW-4YWX6-6F4BT_100_0_____Retail_CoreSingleLanguage 1001 | 2b1f36bb-c1cd-4306-bf5c-a0367c2d97d8_YTMG3-N6DKC-DKB77-7M9GH-8HVX7_101_0_____Retail_Core 1002 | 2a6137f3-75c0-4f26-8e3e-d83d802865a4_XKCNC-J26Q9-KFHD2-FKTHY-KD72Y_119_0_OEM:NONSLP_PPIPro 1003 | e558417a-5123-4f6f-91e7-385c1c7ca9d4_YNMGQ-8RYV3-4PGQ3-C8XTP-7CFBY_121_0_____Retail_Education 1004 | c5198a66-e435-4432-89cf-ec777c9d0352_84NGF-MHBT6-FXBX8-QWJK7-DRR8H_122_0_____Retail_EducationN 1005 | cce9d2de-98ee-4ce2-8113-222620c64a27_KCNVH-YKWX8-GJJB9-H9FDT-6F7W2_125_1_Volume:MAK_EnterpriseS_2021 1006 | d06934ee-5448-4fd1-964a-cd077618aa06_43TBQ-NH92J-XKTM7-KT3KK-P39PB_125_0_OEM:NONSLP_EnterpriseS_2019 1007 | 706e0cfd-23f4-43bb-a9af-1a492b9f1302_NK96Y-D9CD8-W44CQ-R8YTK-DYJWX_125_0_OEM:NONSLP_EnterpriseS_2016 1008 | faa57748-75c8-40a2-b851-71ce92aa8b45_FWN7H-PF93Q-4GGP8-M8RF3-MDWWW_125_0_OEM:NONSLP_EnterpriseS_2015 1009 | 2c060131-0e43-4e01-adc1-cf5ad1100da8_RQFNW-9TPM3-JQ73T-QV4VQ-DV9PT_126_1_Volume:MAK_EnterpriseSN_2021 1010 | e8f74caa-03fb-4839-8bcc-2e442b317e53_M33WV-NHY3C-R7FPM-BQGPT-239PG_126_1_Volume:MAK_EnterpriseSN_2019 1011 | 3d1022d8-969f-4222-b54b-327f5a5af4c9_2DBW3-N2PJG-MVHW3-G7TDK-9HKR4_126_0_Volume:MAK_EnterpriseSN_2016 1012 | 60c243e1-f90b-4a1b-ba89-387294948fb6_NTX6B-BRYC2-K6786-F6MVQ-M7V2X_126_0_Volume:MAK_EnterpriseSN_2015 1013 | a48938aa-62fa-4966-9d44-9f04da3f72f2_G3KNM-CHG6T-R36X3-9QDG6-8M8K9_138_1_____Retail_ProfessionalSingleLanguage 1014 | f7af7d09-40e4-419c-a49b-eae366689ebd_HNGCC-Y38KG-QVK8D-WMWRK-X86VK_139_1_____Retail_ProfessionalCountrySpecific 1015 | eb6d346f-1c60-4643-b960-40ec31596c45_DXG7C-N36C4-C4HTG-X4T3X-2YV77_161_0_____Retail_ProfessionalWorkstation 1016 | 89e87510-ba92-45f6-8329-3afa905e3e83_WYPNQ-8C467-V2W6J-TX4WX-WT2RQ_162_0_____Retail_ProfessionalWorkstationN 1017 | 62f0c100-9c53-4e02-b886-a3528ddfe7f6_8PTT6-RNW4C-6V7J2-C2D3X-MHBPB_164_0_____Retail_ProfessionalEducation 1018 | 13a38698-4a49-4b9e-8e83-98fe51110953_GJTYN-HDMQY-FRR76-HVGC7-QPF8P_165_0_____Retail_ProfessionalEducationN 1019 | 1ca0bfa8-d96b-4815-a732-7756f30c29e2_FV469-WGNG4-YQP66-2B2HY-KD8YX_171_1_OEM:NONSLP_EnterpriseG 1020 | 8d6f6ffe-0c30-40ec-9db2-aad7b23bb6e3_FW7NV-4T673-HF4VX-9X4MM-B4H4T_172_1_OEM:NONSLP_EnterpriseGN 1021 | df96023b-dcd9-4be2-afa0-c6c871159ebe_NJCF7-PW8QT-3324D-688JX-2YV66_175_0_____Retail_ServerRdsh 1022 | d4ef7282-3d2c-4cf0-9976-8854e64a8d1e_V3WVW-N2PV2-CGWC3-34QGF-VMJ2C_178_0_____Retail_Cloud 1023 | af5c9381-9240-417d-8d35-eb40cd03e484_NH9J3-68WK7-6FB93-4K3DF-DJ4F6_179_0_____Retail_CloudN 1024 | c7051f63-3a76-4992-bce5-731ec0b1e825_2HN6V-HGTM8-6C97C-RK67V-JQPFD_183_1_____Retail_CloudE 1025 | 8ab9bdd1-1f67-4997-82d9-8878520837d9_XQQYW-NFFMW-XJPBH-K8732-CKFFD_188_0_____OEM:DM_IoTEnterprise 1026 | ed655016-a9e8-4434-95d9-4345352c2552_QPM6N-7J2WJ-P88HH-P3YRH-YY74H_191_0_OEM:NONSLP_IoTEnterpriseS 1027 | d4bdc678-0a4b-4a32-a5b3-aaa24c3b0f24_K9VKN-3BGWV-Y624W-MCRMQ-BHDCD_202_0_____Retail_CloudEditionN 1028 | 92fb8726-92a8-4ffc-94ce-f82e07444653_KY7PN-VR6RX-83W6Y-6DDYQ-T6R4W_203_0_____Retail_CloudEdition 1029 | ) do ( 1030 | for /f "tokens=1-7 delims=_" %%A in ("%%#") do if %osSKU%==%%C ( 1031 | 1032 | if %1==attempt1 if not defined key echo "!applist!" | find /i "%%A" 1>nul && (set "key=%%B" & set "_chan=%%E" & if %%D==1 set notworking=1) 1033 | 1034 | if %1==attempt2 if not defined key ( 1035 | set "actidnotfound= [Mismatched Act-ID]" 1036 | set 7th=%%G 1037 | if not defined 7th ( 1038 | set "key=%%B" & set "_chan=%%E" & if %%D==1 set notworking=1 1039 | ) else ( 1040 | echo "%winos%" | find "%%G" 1>nul && (set "key=%%B" & set "_chan=%%E" & if %%D==1 set notworking=1) 1041 | ) 1042 | ) 1043 | ) 1044 | ) 1045 | exit /b 1046 | 1047 | ::======================================================================================================================================== -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Win10_LTSC_2021_FixPacks 2 | 一键修复win10 ltsc 2021官方镜像的CPU占用问题,输入法显示问题并添加微软应用商店。 3 | 4 | ## 说明 5 | 6 | **本文件中的激活模块整合了** 7 | 8 | - luzea9903 \ winactivate :https://github.com/luzea9903/winactivate 9 | - massgravel \ Microsoft-Activation-Scripts :https://github.com/massgravel/Microsoft-Activation-Scripts 10 | 11 | *两种激活方法均可以使用,随便选一个使用就可以,如果有一个失败,尝试运行另外一个* 12 | 13 | **官方的Win10 LTSC 2021镜像存在的bug** 14 | 15 | - 进程`wsappx`长期占用CPU资源。 16 | - 微软中文输入法不显示候选词。 17 | - 缺少微软应用商店。 18 | 19 | **问题分析** 20 | 21 | 查阅得知`wsappx`是微软应用商店自动更新相关的服务,所以猜测可能是因为LTSC系统中微软精简掉了微软应用商店和UWP应用的相关服务,所以有可能是缺少相应的运行环境,导致`wsappx`死循环无法正常工作,从而占用大量的CPU资源。 22 | 23 | 对于微软中文输入法不显示候选词的显示问题,当我们进入>微软拼音输入法设置>常规>兼容性中选择使用以前版本的输入法后,输入法显示正常。所以这个显示问题仅仅出现在新版本的输入法上面,而在普通消费者版本的Win10 21H2版本中,输入法并不存在此问题。所以猜测有可能是因为精简版本中精简掉不必要的文件,而导致的bug。 24 | 25 | 通过查阅得知,以上问题都是因为LTSC精简掉了这些软件所需要的VCLibs依赖库,导致部分功能无法实现,于是就出现了bug。 26 | 27 | 所以需要解决此问题仅需要手动安装VCLibs库即可。 28 | 29 | 考虑到日常使用中微软应用商店还是比较方便的,而微软商店同时需要VCLibs依赖库,所以本脚本解决以上问题的方案为安装微软应用商店。 30 | 31 | ## 使用方法 32 | 33 | 1. 前往项目 release 处下载文件 `Win10_LTSC_2021_FixPacks.zip`。 34 | 35 | 如果速度过慢,这里提供另外的下载地址。 36 | 37 | 文件分享地址:[https://www.123pan.com/s/yCC9-8Ig23](https://www.123pan.com/s/yCC9-8Ig23) 提取码:6666 38 | 39 | 分享链接中的两个win10 LTSC 2021镜像分别为微软官方的64位和32位镜像。 40 | 41 | 2. 解压下载的压缩包文件。 42 | 43 | 3. 右键以管理员权限运行`RunThis.cmd`文件。 44 | 45 | ![](https://pic.imgdb.cn/item/629180020947543129f91dc8.jpg) 46 | 47 | 4. 根据提示和需求选择相应的运行选项。 48 | -------------------------------------------------------------------------------- /README.txt: -------------------------------------------------------------------------------- 1 | Chinese: 2 | 1. 直接右键以管理员身份运行 RunThis.cmd 脚本。 3 | 4 | English: 5 | 1. Right click and run RunThis.cmd as administrator. -------------------------------------------------------------------------------- /RunThis.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | @REM brokyz 3 | 4 | openfiles 1>nul 2>nul || goto :administrator 5 | if /i "%PROCESSOR_ARCHITECTURE%" equ "AMD64" (set "arch=x64") else (set "arch=x86") 6 | set ROOT_DIR=%~dp0 7 | 8 | :first 9 | cls 10 | echo. 11 | echo %ROOT_DIR% 12 | echo. 13 | echo ============================================================ 14 | echo Win10 LTSC 2021 FixPacks 15 | echo ============================================================ 16 | echo. 17 | echo 1. Activate Win10 LTSC 2021 (winactivate) 18 | echo 2. Activate Win10 LTSC 2021 (HWID_Activation) 19 | echo 3. Fix-LTSC2021 20 | echo 4. Add MicrosoftStore 21 | echo 5. Exit 22 | echo. 23 | echo ============================================================ 24 | echo. 25 | echo Chose the option you need: 26 | set /p opt= 27 | if %opt%==1 goto :activate 28 | if %opt%==2 goto :HWID-KMS38_Activation 29 | if %opt%==3 goto :fix 30 | if %opt%==4 goto :installMicrosoftStore 31 | if %opt%==5 goto :exit 32 | echo error: Please check you input. 33 | goto :first 34 | 35 | 36 | :activate 37 | echo. 38 | call %ROOT_DIR%Winactivate\winactivate.cmd 39 | echo. 40 | echo finished. 41 | echo . 42 | goto :first 43 | 44 | :HWID-KMS38_Activation 45 | echo. 46 | call %ROOT_DIR%HWID-KMS38_Activation\HWID_Activation.cmd 47 | echo. 48 | echo finished. 49 | echo . 50 | goto :first 51 | 52 | :fix 53 | echo. 54 | call %ROOT_DIR%Fix-LTSC2021\Fix-LTSC2021.cmd 55 | echo. 56 | echo finished. 57 | echo . 58 | goto :first 59 | 60 | 61 | :installMicrosoftStore 62 | echo. 63 | call %ROOT_DIR%Add-Store\Add-Store.cmd 64 | echo. 65 | echo finished. 66 | echo. 67 | goto :first 68 | 69 | 70 | :administrator 71 | echo. 72 | echo Please run this by administrator privilege. 73 | echo. 74 | echo Press any key to exit. 75 | pause >nul 76 | :exit 77 | exit 78 | -------------------------------------------------------------------------------- /Winactivate/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 luzea 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Winactivate/README.md: -------------------------------------------------------------------------------- 1 | 此激活方案整合了 [luzea9903](https://github.com/luzea9903)的[winactivate](https://github.com/luzea9903/winactivate) 2 | 3 | 原项目地址:[https://github.com/luzea9903/winactivate](https://github.com/luzea9903/winactivate) -------------------------------------------------------------------------------- /Winactivate/gatherosstate.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brokyz/Win10_LTSC_2021_FixPacks/f5c72570930fabd4528abd911e93bf2c6c0fd18d/Winactivate/gatherosstate.exe -------------------------------------------------------------------------------- /Winactivate/slc.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brokyz/Win10_LTSC_2021_FixPacks/f5c72570930fabd4528abd911e93bf2c6c0fd18d/Winactivate/slc.dll -------------------------------------------------------------------------------- /Winactivate/winactivate.cmd: -------------------------------------------------------------------------------- 1 | @powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0winactivate.ps1" %* 2 | -------------------------------------------------------------------------------- /Winactivate/winactivate.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param ( 3 | [Parameter()] 4 | [switch] 5 | $ForceKMS38, 6 | [Parameter()] 7 | [switch] 8 | $Headless, 9 | [Parameter()] 10 | [string] 11 | $ProductKey 12 | ) 13 | 14 | function Activate-Windows { 15 | 16 | process { 17 | Invoke-CimMethod -MethodName 'Activate' -Query 'SELECT * FROM SoftwareLicensingProduct WHERE ApplicationID = ''55c92734-d682-4d71-983e-d6ec3f16059f'' AND PartialProductKey IS NOT NULL' -ErrorAction Stop | Out-Null 18 | } 19 | 20 | } 21 | 22 | function Exit-Script { 23 | 24 | [CmdletBinding()] 25 | param ( 26 | [Parameter(Position = 0)] 27 | [int] 28 | $ExitCode = 0 29 | ) 30 | 31 | process { 32 | $TemporaryFiles = @( 33 | 'gatherosstatemodified.exe' 34 | 'GenuineTicket.xml' 35 | ) 36 | 37 | foreach ($TemporaryFile in $TemporaryFiles) { 38 | if (Test-Path -Path $TemporaryFile) { 39 | Remove-Item -Path $TemporaryFile -Force 40 | } 41 | } 42 | 43 | Pop-Location 44 | 45 | if (!$Headless.IsPresent) { 46 | Pause 47 | } 48 | 49 | Exit $ExitCode 50 | } 51 | 52 | } 53 | 54 | function Get-BuildNumber { 55 | 56 | process { 57 | [int](Get-CimInstance -Query 'SELECT BuildNumber FROM Win32_OperatingSystem').BuildNumber 58 | } 59 | 60 | } 61 | 62 | function Get-HWIDProductKey { 63 | 64 | [CmdletBinding()] 65 | param ( 66 | [Parameter(Mandatory = $true, Position = 0)] 67 | [int] 68 | $SkuId, 69 | [Parameter(Mandatory = $true, Position = 1)] 70 | [int] 71 | $Build 72 | ) 73 | 74 | process { 75 | $ProductKey = $null 76 | 77 | $ProductKeys = @{ 78 | 4 = 'XGVPP-NMH47-7TTHJ-W3FW7-8HV2C' 79 | 27 = '3V6Q6-NQXCX-V8YXR-9QCYV-QPFCT' 80 | 48 = 'VK7JG-NPHTM-C97JM-9MPGT-3V66T' 81 | 49 = '2B87N-8KFHP-DKV6R-Y2C8J-PKCKT' 82 | 98 = '4CPRK-NM3K3-X6XXQ-RXX86-WXCHW' 83 | 99 = 'N2434-X9D7W-8PF6X-8DV9T-8TYMD' 84 | 100 = 'BT79Q-G7N6G-PGBYW-4YWX6-6F4BT' 85 | 101 = 'YTMG3-N6DKC-DKB77-7M9GH-8HVX7' 86 | 121 = 'YNMGQ-8RYV3-4PGQ3-C8XTP-7CFBY' 87 | 122 = '84NGF-MHBT6-FXBX8-QWJK7-DRR8H' 88 | 161 = 'DXG7C-N36C4-C4HTG-X4T3X-2YV77' 89 | 162 = 'WYPNQ-8C467-V2W6J-TX4WX-WT2RQ' 90 | 164 = '8PTT6-RNW4C-6V7J2-C2D3X-MHBPB' 91 | 165 = 'GJTYN-HDMQY-FRR76-HVGC7-QPF8P' 92 | 175 = 'NJCF7-PW8QT-3324D-688JX-2YV66' 93 | 188 = 'XQQYW-NFFMW-XJPBH-K8732-CKFFD' 94 | 191 = 'QPM6N-7J2WJ-P88HH-P3YRH-YY74H' 95 | 203 = 'KY7PN-VR6RX-83W6Y-6DDYQ-T6R4W' 96 | } 97 | 98 | if ($null -ne $ProductKeys[$SkuId]) { 99 | $ProductKey = $ProductKeys[$SkuId] 100 | } 101 | 102 | switch ($Build) { 103 | {$_ -eq 10240} { 104 | $ProductKeys = @{ 105 | 125 = 'FWN7H-PF93Q-4GGP8-M8RF3-MDWWW' 106 | 126 = '8V8WN-3GXBH-2TCMG-XHRX3-9766K' 107 | } 108 | } 109 | {$_ -eq 14393} { 110 | $ProductKeys = @{ 111 | 125 = 'NK96Y-D9CD8-W44CQ-R8YTK-DYJWX' 112 | 126 = '2DBW3-N2PJG-MVHW3-G7TDK-9HKR4' 113 | } 114 | } 115 | {$_ -eq 17763} { 116 | $ProductKeys = @{ 117 | 125 = '43TBQ-NH92J-XKTM7-KT3KK-P39PB' 118 | 126 = 'M33WV-NHY3C-R7FPM-BQGPT-239PG' 119 | } 120 | } 121 | } 122 | 123 | if ($null -ne $ProductKeys[$SkuId]) { 124 | $ProductKey = $ProductKeys[$SkuId] 125 | } 126 | 127 | $ProductKey 128 | } 129 | 130 | } 131 | 132 | function Get-KMS38ProductKey { 133 | 134 | [CmdletBinding()] 135 | param ( 136 | [Parameter(Mandatory = $true, Position = 0)] 137 | [int] 138 | $SkuId, 139 | [Parameter(Mandatory = $true, Position = 1)] 140 | [int] 141 | $Build 142 | ) 143 | 144 | process { 145 | $ProductKey = $null 146 | 147 | $ProductKeys = @{ 148 | 4 = 'NPPR9-FWDCX-D2C8J-H872K-2YT43' 149 | 27 = 'DPH2V-TTNVB-4X9Q3-TJR4H-KHJW4' 150 | 48 = 'W269N-WFGWX-YVC9B-4J6C9-T83GX' 151 | 49 = 'MH37W-N47XK-V7XM9-C7227-GCQG9' 152 | 98 = '3KHY7-WNT83-DGQKR-F7HPR-844BM' 153 | 99 = 'PVMJN-6DFY6-9CCP6-7BKTT-D3WVR' 154 | 100 = '7HNRX-D7KGG-3K4RQ-4WPJ4-YTDFH' 155 | 101 = 'TX9XD-98N7V-6WMQ6-BX7FG-H8Q99' 156 | 121 = 'NW6C2-QMPVW-D7KKK-3GKT6-VCFB2' 157 | 122 = '2WH4N-8QGBV-H22JP-CT43Q-MDWWJ' 158 | 161 = 'NRG8B-VKK3Q-CXVCJ-9G2XF-6Q84J' 159 | 162 = '9FNHH-K3HBT-3W4TD-6383H-6XYWF' 160 | 164 = '6TP4R-GNPTD-KYYHQ-7B7DP-J447Y' 161 | 165 = 'YVWGF-BXNMC-HTQYQ-CPQ99-66QFC' 162 | 171 = 'YYVX9-NTFWV-6MDM3-9PT4T-4M68B' 163 | 172 = '44RPN-FTY23-9VTTB-MP9BX-T84FV' 164 | 175 = '7NBT4-WGBQX-MP4H7-QXFF8-YP3KX' 165 | } 166 | 167 | if ($null -ne $ProductKeys[$SkuId]) { 168 | $ProductKey = $ProductKeys[$SkuId] 169 | } 170 | 171 | switch ($Build) { 172 | {$_ -eq 10240} { 173 | $ProductKeys = @{ 174 | 125 = 'WNMTR-4C88C-JK8YV-HQ7T2-76DF9' 175 | 126 = '2F77B-TNFGY-69QQF-B8YKP-D69TJ' 176 | } 177 | } 178 | {$_ -eq 14393} { 179 | $ProductKeys = @{ 180 | 7 = 'WC2BQ-8NRM3-FDDYY-2BFGV-KHKQY' 181 | 8 = 'CB7KF-BWN84-R7R2Y-793K2-8XDDG' 182 | 50 = 'JCKRF-N37P4-C2D82-9YXRT-4M63B' 183 | 125 = 'DCPHK-NFMTC-H88MJ-PFHPY-QJ4BJ' 184 | 126 = 'QFFDN-GRT3P-VKWWX-X7T3R-8B639' 185 | 145 = '2HXDN-KRXHB-GPYC7-YCKFJ-7FVDG' 186 | 146 = 'PTXN8-JFHJM-4WC78-MPCBR-9W4KR' 187 | 168 = 'VP34G-4NPPG-79JTQ-864T4-R3MQX' 188 | } 189 | } 190 | {$_ -eq 17763} { 191 | $ProductKeys = @{ 192 | 7 = 'N69G4-B89J2-4G8F4-WWYCC-J464C' 193 | 8 = 'WMDGN-G9PQG-XVVXX-R3X43-63DFG' 194 | 50 = 'WVDHN-86M7X-466P6-VHXV7-YY726' 195 | 125 = 'M7XTQ-FN8P6-TTKYV-9D4CC-J462D' 196 | 126 = '92NFX-8DJQP-P6BBQ-THF9C-7CG2H' 197 | 145 = '6NMRW-2C8FM-D24W7-TQWMY-CWH2D' 198 | 146 = 'N2KJX-J94YW-TQVFB-DG9YT-724CC' 199 | 168 = 'FDNH6-VW9RW-BXPJ7-4XTYG-239TB' 200 | } 201 | } 202 | {$_ -eq 19044} { 203 | $ProductKeys = @{ 204 | 125 = 'M7XTQ-FN8P6-TTKYV-9D4CC-J462D' 205 | 126 = '92NFX-8DJQP-P6BBQ-THF9C-7CG2H' 206 | } 207 | } 208 | {$_ -ge 20348} { 209 | $ProductKeys = @{ 210 | 7 = 'VDYBN-27WPP-V4HQT-9VMD4-VMK7H' 211 | 8 = 'WX4NM-KYWYW-QJJR4-XV3QB-6VM33' 212 | 145 = 'QFND9-D3Y9C-J3KKY-6RPVP-2DPYV' 213 | 146 = '67KN8-4FYJW-2487Q-MQ2J7-4C4RG' 214 | 168 = '6N379-GGTMK-23C6M-XVVTC-CKFRQ' 215 | } 216 | } 217 | } 218 | 219 | if ($null -ne $ProductKeys[$SkuId]) { 220 | $ProductKey = $ProductKeys[$SkuId] 221 | } 222 | 223 | $ProductKey 224 | } 225 | 226 | } 227 | 228 | function Get-LicenseStatus { 229 | 230 | process { 231 | [int](Get-CimInstance -Query 'SELECT LicenseStatus FROM SoftwareLicensingProduct WHERE ApplicationID = ''55c92734-d682-4d71-983e-d6ec3f16059f'' AND PartialProductKey IS NOT NULL').LicenseStatus 232 | } 233 | 234 | } 235 | 236 | function Get-SKU { 237 | 238 | process { 239 | [int](Get-CimInstance -Query 'SELECT OperatingSystemSKU FROM Win32_OperatingSystem').OperatingSystemSKU 240 | } 241 | 242 | } 243 | 244 | function Install-ProductKey { 245 | 246 | [CmdletBinding()] 247 | param ( 248 | [Parameter(Mandatory = $true, Position = 0)] 249 | [string] 250 | $ProductKey 251 | ) 252 | 253 | process { 254 | Invoke-CimMethod -Arguments @{'ProductKey' = $ProductKey} -MethodName 'InstallProductKey' -Query 'SELECT * FROM SoftwareLicensingService' -ErrorAction Stop | Out-Null 255 | } 256 | 257 | } 258 | 259 | function Set-KeyManagementServiceMachine { 260 | 261 | process { 262 | Invoke-CimMethod -Arguments @{'MachineName' = '127.0.0.1'} -MethodName 'SetKeyManagementServiceMachine' -Query 'SELECT * FROM SoftwareLicensingProduct WHERE ApplicationID = ''55c92734-d682-4d71-983e-d6ec3f16059f'' AND PartialProductKey IS NOT NULL' -ErrorAction Stop | Out-Null 263 | } 264 | 265 | } 266 | 267 | function Test-AdministrativePrivileges { 268 | 269 | process { 270 | ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) 271 | } 272 | 273 | } 274 | 275 | function Test-KMS38ProductKey { 276 | 277 | [CmdletBinding()] 278 | param ( 279 | [Parameter(Mandatory = $true, Position = 0)] 280 | [string] 281 | $ProductKey 282 | ) 283 | 284 | process { 285 | $KMS38ProductKeys = @( 286 | '2F77B-TNFGY-69QQF-B8YKP-D69TJ' 287 | '2HXDN-KRXHB-GPYC7-YCKFJ-7FVDG' 288 | '2WH4N-8QGBV-H22JP-CT43Q-MDWWJ' 289 | '3KHY7-WNT83-DGQKR-F7HPR-844BM' 290 | '44RPN-FTY23-9VTTB-MP9BX-T84FV' 291 | '67KN8-4FYJW-2487Q-MQ2J7-4C4RG' 292 | '6N379-GGTMK-23C6M-XVVTC-CKFRQ' 293 | '6NMRW-2C8FM-D24W7-TQWMY-CWH2D' 294 | '6TP4R-GNPTD-KYYHQ-7B7DP-J447Y' 295 | '7HNRX-D7KGG-3K4RQ-4WPJ4-YTDFH' 296 | '7NBT4-WGBQX-MP4H7-QXFF8-YP3KX' 297 | '92NFX-8DJQP-P6BBQ-THF9C-7CG2H' 298 | '92NFX-8DJQP-P6BBQ-THF9C-7CG2H' 299 | '9FNHH-K3HBT-3W4TD-6383H-6XYWF' 300 | 'CB7KF-BWN84-R7R2Y-793K2-8XDDG' 301 | 'DCPHK-NFMTC-H88MJ-PFHPY-QJ4BJ' 302 | 'DPH2V-TTNVB-4X9Q3-TJR4H-KHJW4' 303 | 'FDNH6-VW9RW-BXPJ7-4XTYG-239TB' 304 | 'JCKRF-N37P4-C2D82-9YXRT-4M63B' 305 | 'M7XTQ-FN8P6-TTKYV-9D4CC-J462D' 306 | 'M7XTQ-FN8P6-TTKYV-9D4CC-J462D' 307 | 'MH37W-N47XK-V7XM9-C7227-GCQG9' 308 | 'N2KJX-J94YW-TQVFB-DG9YT-724CC' 309 | 'N69G4-B89J2-4G8F4-WWYCC-J464C' 310 | 'NPPR9-FWDCX-D2C8J-H872K-2YT43' 311 | 'NRG8B-VKK3Q-CXVCJ-9G2XF-6Q84J' 312 | 'NW6C2-QMPVW-D7KKK-3GKT6-VCFB2' 313 | 'PTXN8-JFHJM-4WC78-MPCBR-9W4KR' 314 | 'PVMJN-6DFY6-9CCP6-7BKTT-D3WVR' 315 | 'QFFDN-GRT3P-VKWWX-X7T3R-8B639' 316 | 'QFND9-D3Y9C-J3KKY-6RPVP-2DPYV' 317 | 'TX9XD-98N7V-6WMQ6-BX7FG-H8Q99' 318 | 'VDYBN-27WPP-V4HQT-9VMD4-VMK7H' 319 | 'VP34G-4NPPG-79JTQ-864T4-R3MQX' 320 | 'W269N-WFGWX-YVC9B-4J6C9-T83GX' 321 | 'WC2BQ-8NRM3-FDDYY-2BFGV-KHKQY' 322 | 'WMDGN-G9PQG-XVVXX-R3X43-63DFG' 323 | 'WNMTR-4C88C-JK8YV-HQ7T2-76DF9' 324 | 'WVDHN-86M7X-466P6-VHXV7-YY726' 325 | 'WX4NM-KYWYW-QJJR4-XV3QB-6VM33' 326 | 'YVWGF-BXNMC-HTQYQ-CPQ99-66QFC' 327 | 'YYVX9-NTFWV-6MDM3-9PT4T-4M68B' 328 | ) 329 | 330 | if ($KMS38ProductKeys.Contains($ProductKey)) { 331 | $true 332 | } 333 | 334 | $false 335 | } 336 | 337 | } 338 | 339 | Push-Location -Path $PSScriptRoot 340 | 341 | Write-Host @' 342 | ============================================================= 343 | winactivate v2.0 - https://github.com/luzeadev/winactivate 344 | ============================================================= 345 | 346 | '@ 347 | 348 | if (!(Test-AdministrativePrivileges)) { 349 | Write-Error 'This script requires administrative privileges.' 350 | Exit-Script -ExitCode 1 351 | } 352 | 353 | $Build = Get-BuildNumber 354 | if ($Build -lt 10240) { 355 | Write-Error 'This build of Windows isn''t supported by this script.' 356 | Exit-Script -ExitCode 1 357 | } 358 | 359 | if ($ProductKey.Length -eq 0) { 360 | $SkuId = Get-SKU 361 | if ($ForceKMS38.IsPresent) { 362 | $ProductKey = Get-KMS38ProductKey -SkuId $SkuId -Build $Build 363 | } else { 364 | $ProductKey = Get-HWIDProductKey -SkuId $SkuId -Build $Build 365 | 366 | if ($ProductKey.Length -eq 0) { 367 | $ProductKey = Get-KMS38ProductKey -SkuId $SkuId -Build $Build 368 | } 369 | } 370 | } 371 | 372 | if ($null -eq $ProductKey) { 373 | Write-Error 'This edition of Windows isn''t supported by this script.' 374 | Exit-Script -ExitCode 1 375 | } 376 | 377 | Write-Host "Installing product key $ProductKey..." 378 | try { 379 | Install-ProductKey -ProductKey $ProductKey 380 | } catch { 381 | Write-Error $_ 382 | Exit-Script -ExitCode 1 383 | } 384 | Write-Host 'Done.' -ForegroundColor Magenta 385 | Write-Host 386 | 387 | if (Test-KMS38ProductKey -ProductKey $ProductKey) { 388 | Write-Host 'Setting key management service machine to 127.0.0.1...' 389 | try { 390 | Set-KeyManagementServiceMachine 391 | } catch { 392 | Write-Error $_ 393 | Exit-Script -ExitCode 1 394 | } 395 | Write-Host 'Done.' -ForegroundColor Magenta 396 | Write-Host 397 | } 398 | 399 | Write-Host 'Patching gatherosstate.exe...' 400 | $Process = Start-Process -FilePath 'rundll32.exe' -ArgumentList """$PSScriptRoot\slc.dll"",PatchGatherosstate" -PassThru -Wait 401 | if ($Process.ExitCode -ne 0) { 402 | Write-Error 'Failed to patch gatherosstate.exe.' 403 | Exit-Script -ExitCode 1 404 | } 405 | Write-Host 'Done.' -ForegroundColor Magenta 406 | Write-Host 407 | 408 | Write-Host 'Generating GenuineTicket.xml...' 409 | $Process = Start-Process -FilePath "$PSScriptRoot\gatherosstatemodified.exe" -PassThru -Wait 410 | if ($Process.ExitCode -ne 0) { 411 | Write-Error 'Failed to generate GenuineTicket.xml.' 412 | Exit-Script -ExitCode 1 413 | } 414 | Write-Host 'Done.' -ForegroundColor Magenta 415 | Write-Host 416 | 417 | Write-Host 'Applying GenuineTicket.xml...' 418 | Copy-Item -Path "$PSScriptRoot\GenuineTicket.xml" -Destination "$env:SystemDrive\ProgramData\Microsoft\Windows\ClipSVC\GenuineTicket" -Force 419 | $Process = Start-Process -FilePath 'ClipUp.exe' -ArgumentList '-o' -PassThru -WindowStyle Hidden -Wait 420 | if ($Process.ExitCode -ne 0) { 421 | Write-Error 'Failed to apply GenuineTicket.xml.' 422 | Exit-Script -ExitCode 1 423 | } 424 | Write-Host 'Done.' -ForegroundColor Magenta 425 | Write-Host 426 | 427 | Write-Host 'Activating Windows...' 428 | if (!(Test-KMS38ProductKey -ProductKey $ProductKey)) { 429 | try { 430 | Activate-Windows 431 | } catch { 432 | Write-Error $_ 433 | Exit-Script -ExitCode 1 434 | } 435 | } 436 | $LicenseStatus = Get-LicenseStatus 437 | if ($LicenseStatus -ne 1) { 438 | Write-Error 'Failed to activate Windows.' 439 | Exit-Script -ExitCode 1 440 | } 441 | Write-Host 'Done.' -ForegroundColor Magenta 442 | Write-Host 443 | 444 | Exit-Script -ExitCode 0 445 | --------------------------------------------------------------------------------