mirror of
https://github.com/massgravel/Microsoft-Activation-Scripts.git
synced 2025-07-06 09:51:20 +01:00
Compare commits
10 Commits
3.3
...
409c4f71ad
Author | SHA1 | Date | |
---|---|---|---|
409c4f71ad | |||
d7a6994363 | |||
5ad6226f37 | |||
ae9f4e34ff | |||
67abcd0c89 | |||
faf3bf3a08 | |||
482600c890 | |||
dc90e1ff0f | |||
f969378f6b | |||
c89bebdee8 |
6
.gitattributes
vendored
6
.gitattributes
vendored
@ -1,4 +1,4 @@
|
||||
MAS export-ignore
|
||||
LICENSE export-ignore
|
||||
README.md export-ignore
|
||||
# MAS export-ignore
|
||||
# LICENSE export-ignore
|
||||
# README.md export-ignore
|
||||
.gitattributes export-ignore
|
||||
|
@ -1,5 +1,5 @@
|
||||
@::fh36d7f-random
|
||||
@set masver=3.3
|
||||
@::yfh37fow-random
|
||||
@set masver=3.4
|
||||
@setlocal DisableDelayedExpansion
|
||||
@echo off
|
||||
|
||||
@ -215,7 +215,7 @@ goto dk_done
|
||||
|
||||
::pstst $ExecutionContext.SessionState.LanguageMode :pstst
|
||||
|
||||
for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}" %nul6%') do (set tstresult=%%a)
|
||||
for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':pstst';ie%blank%x ($f[1])}" %nul6%') do (set tstresult=%%a)
|
||||
|
||||
if /i not "%tstresult%"=="FullLanguage" (
|
||||
%eline%
|
||||
@ -283,7 +283,9 @@ set terminal=
|
||||
|
||||
if defined terminal (
|
||||
set lines=0
|
||||
for /f "skip=2 tokens=2 delims=: " %%A in ('mode con') do if "!lines!"=="0" set lines=%%A
|
||||
for /f "skip=3 tokens=* delims=" %%A in ('mode con') do if "!lines!"=="0" (
|
||||
for %%B in (%%A) do set lines=%%B
|
||||
)
|
||||
if !lines! GEQ 100 set terminal=
|
||||
)
|
||||
|
||||
@ -572,7 +574,7 @@ set "_dir=!desktop!\$OEM$\$$\Setup\Scripts"
|
||||
md "!_dir!\"
|
||||
|
||||
:: Add random data on top to create unique file which helps in avoiding AV's detections
|
||||
%psc% "$f=[io.file]::ReadAllText('!_batp!'); [io.file]::WriteAllText('!_pdesk!\$OEM$\$$\Setup\Scripts\MAS_AIO.cmd', '@::RANDOM-' + [Guid]::NewGuid().Guid + [Environment]::NewLine + $f, [System.Text.Encoding]::ASCII)"
|
||||
%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!'); [io.file]::WriteAllText('!_pdesk!\$OEM$\$$\Setup\Scripts\MAS_AIO.cmd', '@::RANDOM-' + [Guid]::NewGuid().Guid + [Environment]::NewLine + $f, [System.Text.Encoding]::ASCII)"
|
||||
|
||||
(
|
||||
echo @echo off
|
||||
@ -795,7 +797,7 @@ set notworking=
|
||||
call :dk_actids 55c92734-d682-4d71-983e-d6ec3f16059f
|
||||
if defined allapps call :hwiddata key
|
||||
if not defined key (
|
||||
for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':getactivationid\:.*';iex ($f[1])"') do (set altapplist=%%a)
|
||||
for /f "delims=" %%a in ('%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':getactivationid\:.*';ie%blank%x ($f[1])"') do (set altapplist=%%a)
|
||||
if defined altapplist call :hwiddata key
|
||||
)
|
||||
|
||||
@ -1206,7 +1208,7 @@ for /f "tokens=3 delims=." %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Con
|
||||
if %_wmic% EQU 1 for /f "tokens=2 delims==" %%a in ('"wmic Path Win32_OperatingSystem Get OperatingSystemSKU /format:LIST" %nul6%') do if not errorlevel 1 set "wmiSKU=%%a"
|
||||
if %_wmic% EQU 0 for /f "tokens=1" %%a in ('%psc% "([WMI]'Win32_OperatingSystem=@').OperatingSystemSKU" %nul6%') do if not errorlevel 1 set "wmiSKU=%%a"
|
||||
|
||||
if %winbuild% GEQ 15063 %psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':winsubstatus\:.*';iex ($f[1])" %nul2% | find /i "Subscription_is_activated" %nul% && (
|
||||
if %winbuild% GEQ 15063 %psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':winsubstatus\:.*';ie%blank%x ($f[1])" %nul2% | find /i "Subscription_is_activated" %nul% && (
|
||||
if defined regSKU if defined slcSKU if not "%regSKU%"=="%slcSKU%" (
|
||||
set winsub=1
|
||||
set osSKU=%regSKU%
|
||||
@ -1653,7 +1655,7 @@ call :dk_color2 %Red% "Checking WinPE " %Blue% "[WinPE
|
||||
|
||||
set wpainfo=
|
||||
set wpaerror=
|
||||
for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':wpatest\:.*';iex ($f[1])" %nul6%') do (set wpainfo=%%a)
|
||||
for /f "delims=" %%a in ('%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':wpatest\:.*';ie%blank%x ($f[1])" %nul6%') do (set wpainfo=%%a)
|
||||
echo "%wpainfo%" | find /i "Error Found" %nul% && (
|
||||
set error=1
|
||||
set wpaerror=1
|
||||
@ -1843,7 +1845,7 @@ set showfix=1
|
||||
if not defined notwinact (
|
||||
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
|
||||
if not defined apps (
|
||||
%psc% "if (-not $env:_vis) {Start-Job { Stop-Service %_slser% -force } | Wait-Job -Timeout 20 | Out-Null}; $sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %nul%
|
||||
%psc% "if (-not $env:_vis) {Start-Job { Stop-Service %_slser% -force } | Wait-Job -Timeout 20 | Out-Null}; $sls = Get-WmiObject SoftwareLicensingService; $f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':xrm\:.*';ie%blank%x ($f[1]); ReinstallLicenses" %nul%
|
||||
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
|
||||
if not defined apps (
|
||||
set "_notfoundids=Key Not Installed / Act ID Not Found"
|
||||
@ -2423,6 +2425,7 @@ set error=1
|
||||
goto :starto16c2r
|
||||
)
|
||||
|
||||
call :oh_expiredpreview 2013
|
||||
call :oh_fixprids
|
||||
call :oh_process
|
||||
if defined isOspp (
|
||||
@ -2480,6 +2483,7 @@ set error=1
|
||||
goto :startmsi
|
||||
)
|
||||
|
||||
call :oh_expiredpreview 2016 2019 2021 2024
|
||||
call :oh_fixprids
|
||||
call :oh_process
|
||||
if defined isOspp (
|
||||
@ -2739,6 +2743,21 @@ exit /b
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
:oh_expiredpreview
|
||||
|
||||
for %%# in (%*) do (
|
||||
if exist "!_oLPath!\ProPlus%%#PreviewVL_*.xrm-ms" if not exist "!_oLPath!\ProPlus%%#VL_*.xrm-ms" (
|
||||
set error=1
|
||||
set showfix=1
|
||||
call :dk_color %Red% "Checking Expired Preview Products [Office %%# Preview Found]"
|
||||
call :dk_color %Blue% "Please run the Office updates first, and then attempt to activate it again."
|
||||
)
|
||||
)
|
||||
|
||||
exit /b
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
:oh_ppcpath
|
||||
|
||||
if not defined isOspp (
|
||||
@ -2853,7 +2872,7 @@ for %%# in ("!_oLPath!\%_License%*.xrm-ms") do (
|
||||
if defined _arr (set "_arr=!_arr!;"!_oLPath!\%%~nx#"") else (set "_arr="!_oLPath!\%%~nx#"")
|
||||
)
|
||||
|
||||
%psc% "$sls = Get-WmiObject %sps%; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); InstallLicenseArr '!_arr!'; InstallLicenseFile '"!_oLPath!\pkeyconfig-office.xrm-ms"'" %nul%
|
||||
%psc% "$sls = Get-WmiObject %sps%; $f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':xrm\:.*';ie%blank%x ($f[1]); InstallLicenseArr '!_arr!'; InstallLicenseFile '"!_oLPath!\pkeyconfig-office.xrm-ms"'" %nul%
|
||||
|
||||
call :dk_actids 0ff1ce15-a989-479d-af46-f275c6370663
|
||||
echo "!allapps!" | find /i "!_actid!" %nul1% || (
|
||||
@ -3365,8 +3384,8 @@ exit /b
|
||||
:oh_licrefresh
|
||||
|
||||
if exist "%SysPath%\spp\store_test\2.0\tokens.dat" (
|
||||
%psc% "Stop-Service sppsvc -force; $sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %nul%
|
||||
if !errorlevel! NEQ 0 %psc% "$sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %nul%
|
||||
%psc% "Stop-Service sppsvc -force; $sls = Get-WmiObject SoftwareLicensingService; $f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':xrm\:.*';ie%blank%x ($f[1]); ReinstallLicenses" %nul%
|
||||
if !errorlevel! NEQ 0 %psc% "$sls = Get-WmiObject SoftwareLicensingService; $f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':xrm\:.*';ie%blank%x ($f[1]); ReinstallLicenses" %nul%
|
||||
)
|
||||
exit /b
|
||||
|
||||
@ -3702,7 +3721,7 @@ exit /b
|
||||
:oh_extractdll
|
||||
|
||||
set b=
|
||||
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':%_hook%\:.*';$encoded = ($f[1]) -replace '-', 'A' -replace '_', 'a';$bytes = [Con%b%vert]::FromBas%b%e64String($encoded); $PePath='%1'; $offset='%2'; $m=[io.file]::ReadAllText('!_batp!') -split ':hexedit\:.*';iex ($m[1])" %nul2% | find /i "Error found" %nul1% && set hasherror=1
|
||||
%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':%_hook%\:.*';$encoded = ($f[1]) -replace '-', 'A' -replace '_', 'a';$bytes = [Con%b%vert]::FromBas%b%e64String($encoded); $PePath='%1'; $offset='%2'; $m=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':hexedit\:.*';ie%blank%x ($m[1])" %nul2% | find /i "Error found" %nul1% && set hasherror=1
|
||||
exit /b
|
||||
|
||||
:hexedit:
|
||||
@ -4097,6 +4116,8 @@ if !_el!==1 cls & setlocal & set "_actwin=1" & call :ts_start & endlocal
|
||||
goto :ts_menu
|
||||
)
|
||||
|
||||
goto :ts_start
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
:ts_changemethod
|
||||
@ -4109,25 +4130,26 @@ echo:
|
||||
echo:
|
||||
echo ______________________________________________________________
|
||||
echo:
|
||||
call :dk_color2 %_White% " [1] " %_Green% " Auto"
|
||||
echo Build 19041 and later:
|
||||
echo Uses StaticCID, or KMS4k if offline.
|
||||
echo Older builds: Uses ZeroCID.
|
||||
echo _______________________________________________
|
||||
call :dk_color2 %_White% " [1] " %_Green% "Auto"
|
||||
echo Builds ^>= 19041 - StaticCID (KMS4k if offline)
|
||||
echo Builds ^< 19041 - ZeroCID
|
||||
echo __________________________________________________
|
||||
echo:
|
||||
echo [2] StaticCID
|
||||
echo Needs Internet.
|
||||
echo Not for Windows 7 or older.
|
||||
echo _______________________________________________
|
||||
echo Needs Internet
|
||||
echo Not for Windows 7 or older
|
||||
echo __________________________________________________
|
||||
echo:
|
||||
echo [3] ZeroCID
|
||||
echo Works only on builds below 19041.
|
||||
echo _______________________________________________
|
||||
echo Works reliably on builds below 19041
|
||||
echo May break on builds between 19041-26100
|
||||
echo Does not work on builds above 26100.4188
|
||||
echo __________________________________________________
|
||||
echo:
|
||||
echo [4] KMS4k
|
||||
echo This applies only to volume products.
|
||||
echo Activates for 4000+ years using KMS.
|
||||
echo _______________________________________________
|
||||
echo Volume licenses only
|
||||
echo Activates for 4000+ years
|
||||
echo __________________________________________________
|
||||
echo:
|
||||
echo [5] Learn More
|
||||
echo [0] %_exitmsg%
|
||||
@ -4266,7 +4288,7 @@ echo Checking Internet Connection [Connected!ping_f!]
|
||||
if /i %_actmethod%==Auto if not %_actman%==1 set tsmethod=KMS4k
|
||||
if /i !tsmethod!==KMS4k (
|
||||
call :dk_color %Gray% "Checking Internet Connection [Not Connected]"
|
||||
call :dk_color %Blue% "Switching To KMS4k Activation Method because Internet is needed for StaticCID method."
|
||||
call :dk_color %Blue% "Switching To KMS4k method because Internet is needed for StaticCID method."
|
||||
) else (
|
||||
set error=1
|
||||
call :dk_color %Red% "Checking Internet Connection [Not Connected]"
|
||||
@ -4338,7 +4360,7 @@ if defined _vis goto :ts_winvista
|
||||
|
||||
set tempid=
|
||||
if /i %tsmethod%==KMS4k (set keytype=ks) else (set keytype=zero)
|
||||
for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':wintsid\:.*';iex ($f[1])" %nul6%') do (
|
||||
for /f "delims=" %%a in ('%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':wintsid\:.*';ie%blank%x ($f[1])" %nul6%') do (
|
||||
echo "%%a" | findstr /r ".*-.*-.*-.*-.*" %nul1% && (set tsids=!tsids! %%a& set tempid=%%a)
|
||||
)
|
||||
|
||||
@ -4628,7 +4650,7 @@ goto :ts_esu
|
||||
)
|
||||
|
||||
set resetstuff=1
|
||||
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':tsforge\:.*';iex ($f[1])"
|
||||
%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':tsforge\:.*';ie%blank%x ($f[1])"
|
||||
set resetstuff=
|
||||
if !errorlevel!==3 (
|
||||
set error=1
|
||||
@ -4977,6 +4999,7 @@ set error=1
|
||||
goto :ts_starto16c2r
|
||||
)
|
||||
|
||||
call :oh_expiredpreview 2013
|
||||
if "%_actprojvis%"=="0" call :oh_fixprids
|
||||
call :ts_process
|
||||
|
||||
@ -5018,6 +5041,7 @@ set error=1
|
||||
goto :ts_startmsi
|
||||
)
|
||||
|
||||
call :oh_expiredpreview 2016 2019 2021 2024
|
||||
if "%_actprojvis%"=="0" call :oh_fixprids
|
||||
call :ts_process
|
||||
|
||||
@ -5101,10 +5125,10 @@ if %winbuild% GEQ 10586 (
|
||||
for %%# in ("%SysPath%\spp\tokens\skus\%tsedition%\*CSVLK*.xrm-ms") do (
|
||||
if defined _arr (set "_arr=!_arr!;"%SysPath%\spp\tokens\skus\%tsedition%\%%~nx#"") else (set "_arr="%SysPath%\spp\tokens\skus\%tsedition%\%%~nx#"")
|
||||
)
|
||||
if defined _arr %psc% "$sls = Get-WmiObject %sps%; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); InstallLicenseArr '!_arr!'" %nul%
|
||||
if defined _arr %psc% "$sls = Get-WmiObject %sps%; $f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':xrm\:.*';ie%blank%x ($f[1]); InstallLicenseArr '!_arr!'" %nul%
|
||||
)
|
||||
|
||||
for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':wintsid\:.*';iex ($f[1])" %nul6%') do (
|
||||
for /f "delims=" %%a in ('%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':wintsid\:.*';ie%blank%x ($f[1])" %nul6%') do (
|
||||
echo "%%a" | findstr /r ".*-.*-.*-.*-.*" %nul1% && (set tsids=!tsids! %%a& set tempid=%%a)
|
||||
)
|
||||
|
||||
@ -5298,7 +5322,7 @@ echo Processing Reset of Rearm / Timers / Tamper / Lock...
|
||||
echo:
|
||||
|
||||
set resetstuff=1
|
||||
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':tsforge\:.*';iex ($f[1])"
|
||||
%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':tsforge\:.*';ie%blank%x ($f[1])"
|
||||
|
||||
if %errorlevel%==3 (
|
||||
call :dk_color %Red% "Reset Failed."
|
||||
@ -5346,7 +5370,7 @@ if %errorlevel%==1 exit /b
|
||||
echo:
|
||||
echo Fetching Supported Activation IDs list. Please wait...
|
||||
|
||||
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':listactids\:.*';iex ($f[1])"
|
||||
%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':listactids\:.*';ie%blank%x ($f[1])"
|
||||
if %errorlevel%==3 (
|
||||
call :dk_color %Gray% "No supported activation ID found, aborting..."
|
||||
goto :dk_done
|
||||
@ -5495,7 +5519,7 @@ echo Writing TrustedStore data...
|
||||
if /i %tsmethod%==StaticCID (echo Depositing Static Confirmation ID...) else (echo Depositing Zero Confirmation ID...)
|
||||
)
|
||||
echo:
|
||||
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':tsforge\:.*';& ([ScriptBlock]::Create($f[1])) %tsids%"
|
||||
%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':tsforge\:.*';& ([ScriptBlock]::Create($f[1])) %tsids%"
|
||||
if !errorlevel!==3 (
|
||||
if %_actman%==0 (if not defined error call :dk_color %Blue% "%_fixmsg%")
|
||||
set fixes=%fixes% %mas%troubleshoot
|
||||
@ -5689,7 +5713,7 @@ echo !_License! | find /i "Retail" %nul% && (set keytype=zero) || (set keytype=k
|
||||
set keytype=zero
|
||||
)
|
||||
|
||||
for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':offtsid\:.*';iex ($f[1])" %nul6%') do (
|
||||
for /f "delims=" %%a in ('%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':offtsid\:.*';ie%blank%x ($f[1])" %nul6%') do (
|
||||
echo "%%a" | findstr /r ".*-.*-.*-.*-.*" %nul1% && (set tsids=!tsids! %%a& set _actid=%%a)
|
||||
)
|
||||
set "_allactid=!tsids!"
|
||||
@ -11984,7 +12008,7 @@ echo:
|
||||
%nul% reg delete "HKU\S-1-5-20\%specific_kms%" /f
|
||||
|
||||
%nul% reg query "HKLM\%specific_kms%" && (
|
||||
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':regdel\:.*';iex ($f[1])"
|
||||
%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':regdel\:.*';ie%blank%x ($f[1])"
|
||||
%nul% reg delete "HKLM\%specific_kms%" /f
|
||||
)
|
||||
|
||||
@ -12154,7 +12178,7 @@ echo Removing the Added Specific KMS Host [Successful]
|
||||
:: Protect KMS38 if opted by the user and conditions are correct
|
||||
|
||||
if defined _k38 (
|
||||
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':regdel\:.*';& ([ScriptBlock]::Create($f[1])) -protect"
|
||||
%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':regdel\:.*';& ([ScriptBlock]::Create($f[1])) -protect"
|
||||
%nul% reg delete "HKLM\%specific_kms%" /f
|
||||
%nul% reg query "HKLM\%specific_kms%" && (
|
||||
echo Protect KMS38 From KMS [Successful] [Locked a Registry Key]
|
||||
@ -12198,7 +12222,7 @@ title Remove KMS38 Protection %masver%
|
||||
%nul% reg delete "HKU\S-1-5-20\%specific_kms%" /f
|
||||
|
||||
%nul% reg query "HKLM\%specific_kms%" && (
|
||||
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':regdel\:.*';iex ($f[1])"
|
||||
%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':regdel\:.*';ie%blank%x ($f[1])"
|
||||
%nul% reg delete "HKLM\%specific_kms%" /f
|
||||
)
|
||||
|
||||
@ -12963,6 +12987,7 @@ set error=1
|
||||
goto :ks_starto16c2r
|
||||
)
|
||||
|
||||
call :oh_expiredpreview 2013
|
||||
if "%_actprojvis%"=="0" call :oh_fixprids
|
||||
call :ks_process
|
||||
|
||||
@ -13003,6 +13028,7 @@ set error=1
|
||||
goto :ks_startmsi
|
||||
)
|
||||
|
||||
call :oh_expiredpreview 2016 2019 2021 2024
|
||||
if "%_actprojvis%"=="0" call :oh_fixprids
|
||||
call :ks_process
|
||||
|
||||
@ -13915,8 +13941,8 @@ set srvlist=
|
||||
set -=
|
||||
|
||||
set "srvlist=kms.03%-%k.org kms-default.cangs%-%hui.net kms.six%-%yin.com kms.moe%-%club.org kms.cgt%-%soft.com"
|
||||
set "srvlist=%srvlist% kms.id%-%ina.cn kms.moe%-%yuuko.com xinch%-%eng213618.cn kms.lol%-%i.best kms.my%-%ds.cloud"
|
||||
set "srvlist=%srvlist% kms.0%-%t.net.cn win.k%-%ms.pub kms.wx%-%lost.com kms.moe%-%yuuko.top kms.gh%-%pym.com"
|
||||
set "srvlist=%srvlist% kms.id%-%ina.cn kms.moe%-%yuuko.com xinch%-%eng213618.cn kms.lol%-%i.best kms.mc%-%06.net"
|
||||
set "srvlist=%srvlist% kms.0%-%t.net.cn win.k%-%ms.pub kms.wx%-%lost.com kms.moe%-%yuuko.top kms.gh%-%xi.com"
|
||||
|
||||
set n=1
|
||||
for %%a in (%srvlist%) do (set %%a=&set server!n!=%%a&set /a n+=1)
|
||||
@ -13975,7 +14001,7 @@ if not defined _int (s%nil%cht%nil%asks /cre%nil%ate /tn "Activation-Run_Once" /
|
||||
if exist "%_temp%\.*" rmdir /s /q "%_temp%\" %nul%
|
||||
|
||||
call :ks_createInfo.txt
|
||||
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split \":_extracttask\:.*`r`n\"; [io.file]::WriteAllText('%_dest%\Activation_task.cmd', '@::%randguid%' + [Environment]::NewLine + $f[1].Trim(), [System.Text.Encoding]::ASCII)"
|
||||
%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit \":_extracttask\:.*`r`n\"; [io.file]::WriteAllText('%_dest%\Activation_task.cmd', '@::%randguid%' + [Environment]::NewLine + $f[1].Trim(), [System.Text.Encoding]::ASCII)"
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
@ -14005,7 +14031,7 @@ exit /b
|
||||
|
||||
:ks_RenExport
|
||||
|
||||
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split \":%~1\:.*`r`n\"; [io.file]::WriteAllText('%~2',$f[1].Trim(),[System.Text.Encoding]::%~3);"
|
||||
%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit \":%~1\:.*`r`n\"; [io.file]::WriteAllText('%~2',$f[1].Trim(),[System.Text.Encoding]::%~3);"
|
||||
exit /b
|
||||
|
||||
::========================================================================================================================================
|
||||
@ -14759,7 +14785,7 @@ mode 100, 36
|
||||
%psc% "&{$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=35;$B.Height=300;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}" %nul%
|
||||
)
|
||||
|
||||
%psc% "$f=[IO.File]::ReadAllText('!_batp!') -split ':sppmgr\:.*';iex ($f[1])"
|
||||
%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':sppmgr\:.*';ie%blank%x ($f[1])"
|
||||
goto dk_done
|
||||
|
||||
:sppmgr:
|
||||
@ -16656,7 +16682,7 @@ echo Checking SPP permission related issues...
|
||||
call :checkperms
|
||||
if defined permerror (
|
||||
call :dk_color %Red% "[!permerror!]"
|
||||
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':fixsppperms\:.*';iex ($f[1])" %nul%
|
||||
%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':fixsppperms\:.*';ie%blank%x ($f[1])" %nul%
|
||||
call :checkperms
|
||||
if defined permerror (
|
||||
call :dk_color %Red% "[!permerror!] [Failed To Fix]"
|
||||
@ -16726,8 +16752,8 @@ if defined _vis (
|
||||
|
||||
echo:
|
||||
echo Reinstalling system licenses...
|
||||
%psc% "$sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %nul%
|
||||
if %errorlevel% NEQ 0 %psc% "$sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %nul%
|
||||
%psc% "$sls = Get-WmiObject SoftwareLicensingService; $f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':xrm\:.*';ie%blank%x ($f[1]); ReinstallLicenses" %nul%
|
||||
if %errorlevel% NEQ 0 %psc% "$sls = Get-WmiObject SoftwareLicensingService; $f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':xrm\:.*';ie%blank%x ($f[1]); ReinstallLicenses" %nul%
|
||||
if %errorlevel% EQU 0 (
|
||||
echo [Successful]
|
||||
) else (
|
||||
@ -17346,7 +17372,7 @@ exit /b
|
||||
|
||||
:regownstart
|
||||
|
||||
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':regown\:.*';iex ($f[1]);"
|
||||
%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':regown\:.*';ie%blank%x ($f[1]);"
|
||||
exit /b
|
||||
|
||||
:: Below code takes ownership of a volatile registry key and deletes it
|
||||
@ -17489,7 +17515,7 @@ set _ntarget=
|
||||
set _wtarget=
|
||||
|
||||
if %winbuild% GEQ 10240 for /f "tokens=4" %%a in ('dism /online /english /Get-TargetEditions ^| findstr /i /c:"Target Edition : "') do (if defined _dtarget (set "_dtarget= !_dtarget! %%a ") else (set "_dtarget= %%a "))
|
||||
if %winbuild% LSS 10240 for /f "tokens=4" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':cbsxml\:.*';& ([ScriptBlock]::Create($f[1])) -GetTargetEditions;" ^| findstr /i /c:"Target Edition : "') do (if defined _ptarget (set "_ptarget= !_ptarget! %%a ") else (set "_ptarget= %%a "))
|
||||
if %winbuild% LSS 10240 for /f "tokens=4" %%a in ('%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':cbsxml\:.*';& ([ScriptBlock]::Create($f[1])) -GetTargetEditions;" ^| findstr /i /c:"Target Edition : "') do (if defined _ptarget (set "_ptarget= !_ptarget! %%a ") else (set "_ptarget= %%a "))
|
||||
|
||||
if %winbuild% GEQ 10240 if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*Edition~*.mum" (
|
||||
if %winbuild% GEQ 17063 call :ced_edilist
|
||||
@ -17695,7 +17721,7 @@ echo:
|
||||
call :ced_prep
|
||||
if defined preperror goto dk_done
|
||||
|
||||
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':dismapi\:.*';& ([ScriptBlock]::Create($f[1])) %targetedition% %key%"
|
||||
%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':dismapi\:.*';& ([ScriptBlock]::Create($f[1])) %targetedition% %key%"
|
||||
call :ced_postprep
|
||||
)
|
||||
%line%
|
||||
@ -17733,7 +17759,7 @@ call :ced_prep
|
||||
if defined preperror goto dk_done
|
||||
|
||||
if %_stg%==0 (set stage=) else (set stage=-StageCurrent)
|
||||
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':cbsxml\:.*';& ([ScriptBlock]::Create($f[1])) -SetEdition %targetedition% %stage%"
|
||||
%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':cbsxml\:.*';& ([ScriptBlock]::Create($f[1])) -SetEdition %targetedition% %stage%"
|
||||
call :ced_postprep
|
||||
%line%
|
||||
|
||||
@ -18477,7 +18503,7 @@ goto :oe_edition
|
||||
cls
|
||||
call :ch_getinfo
|
||||
call :oe_tempcleanup
|
||||
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':getlist\:.*';iex ($f[1])"
|
||||
%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':getlist\:.*';ie%blank%x ($f[1])"
|
||||
|
||||
:oe_editionchange
|
||||
|
||||
@ -18551,7 +18577,7 @@ cls
|
||||
set suites=
|
||||
echo %list% | find /i "Suites" %nul1% && (
|
||||
set suites=1
|
||||
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':getappnames\:.*';iex ($f[1])"
|
||||
%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':getappnames\:.*';ie%blank%x ($f[1])"
|
||||
if not exist %SystemRoot%\Temp\getAppIds.txt (
|
||||
%eline%
|
||||
echo Failed to generate available apps list.
|
||||
@ -19032,7 +19058,7 @@ if not defined terminal mode 105, 32
|
||||
:: Get build number for the target FFN, using build number with OfficeC2RClient.exe command to trigger updates provides accurate results
|
||||
|
||||
set build=
|
||||
for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':getbuild\:.*';iex ($f[1])" %nul6%') do (set build=%%a)
|
||||
for /f "delims=" %%a in ('%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':getbuild\:.*';ie%blank%x ($f[1])" %nul6%') do (set build=%%a)
|
||||
echo "%build%" | find /i "16." %nul% || set build=
|
||||
|
||||
echo:
|
||||
|
@ -1,4 +1,4 @@
|
||||
@set masver=3.3
|
||||
@set masver=3.4
|
||||
@echo off
|
||||
|
||||
|
||||
@ -237,7 +237,7 @@ goto dk_done
|
||||
|
||||
::pstst $ExecutionContext.SessionState.LanguageMode :pstst
|
||||
|
||||
for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}" %nul6%') do (set tstresult=%%a)
|
||||
for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':pstst';ie%blank%x ($f[1])}" %nul6%') do (set tstresult=%%a)
|
||||
|
||||
if /i not "%tstresult%"=="FullLanguage" (
|
||||
%eline%
|
||||
@ -305,7 +305,9 @@ set terminal=
|
||||
|
||||
if defined terminal (
|
||||
set lines=0
|
||||
for /f "skip=2 tokens=2 delims=: " %%A in ('mode con') do if "!lines!"=="0" set lines=%%A
|
||||
for /f "skip=3 tokens=* delims=" %%A in ('mode con') do if "!lines!"=="0" (
|
||||
for %%B in (%%A) do set lines=%%B
|
||||
)
|
||||
if !lines! GEQ 100 set terminal=
|
||||
)
|
||||
|
||||
@ -505,7 +507,7 @@ set notworking=
|
||||
call :dk_actids 55c92734-d682-4d71-983e-d6ec3f16059f
|
||||
if defined allapps call :hwiddata key
|
||||
if not defined key (
|
||||
for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':getactivationid\:.*';iex ($f[1])"') do (set altapplist=%%a)
|
||||
for /f "delims=" %%a in ('%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':getactivationid\:.*';ie%blank%x ($f[1])"') do (set altapplist=%%a)
|
||||
if defined altapplist call :hwiddata key
|
||||
)
|
||||
|
||||
@ -916,7 +918,7 @@ for /f "tokens=3 delims=." %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Con
|
||||
if %_wmic% EQU 1 for /f "tokens=2 delims==" %%a in ('"wmic Path Win32_OperatingSystem Get OperatingSystemSKU /format:LIST" %nul6%') do if not errorlevel 1 set "wmiSKU=%%a"
|
||||
if %_wmic% EQU 0 for /f "tokens=1" %%a in ('%psc% "([WMI]'Win32_OperatingSystem=@').OperatingSystemSKU" %nul6%') do if not errorlevel 1 set "wmiSKU=%%a"
|
||||
|
||||
if %winbuild% GEQ 15063 %psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':winsubstatus\:.*';iex ($f[1])" %nul2% | find /i "Subscription_is_activated" %nul% && (
|
||||
if %winbuild% GEQ 15063 %psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':winsubstatus\:.*';ie%blank%x ($f[1])" %nul2% | find /i "Subscription_is_activated" %nul% && (
|
||||
if defined regSKU if defined slcSKU if not "%regSKU%"=="%slcSKU%" (
|
||||
set winsub=1
|
||||
set osSKU=%regSKU%
|
||||
@ -1347,7 +1349,7 @@ call :dk_color2 %Red% "Checking WinPE " %Blue% "[WinPE
|
||||
|
||||
set wpainfo=
|
||||
set wpaerror=
|
||||
for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':wpatest\:.*';iex ($f[1])" %nul6%') do (set wpainfo=%%a)
|
||||
for /f "delims=" %%a in ('%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':wpatest\:.*';ie%blank%x ($f[1])" %nul6%') do (set wpainfo=%%a)
|
||||
echo "%wpainfo%" | find /i "Error Found" %nul% && (
|
||||
set error=1
|
||||
set wpaerror=1
|
||||
@ -1537,7 +1539,7 @@ set showfix=1
|
||||
if not defined notwinact (
|
||||
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
|
||||
if not defined apps (
|
||||
%psc% "if (-not $env:_vis) {Start-Job { Stop-Service %_slser% -force } | Wait-Job -Timeout 20 | Out-Null}; $sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %nul%
|
||||
%psc% "if (-not $env:_vis) {Start-Job { Stop-Service %_slser% -force } | Wait-Job -Timeout 20 | Out-Null}; $sls = Get-WmiObject SoftwareLicensingService; $f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':xrm\:.*';ie%blank%x ($f[1]); ReinstallLicenses" %nul%
|
||||
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
|
||||
if not defined apps (
|
||||
set "_notfoundids=Key Not Installed / Act ID Not Found"
|
||||
|
@ -1,4 +1,4 @@
|
||||
@set masver=3.3
|
||||
@set masver=3.4
|
||||
@echo off
|
||||
|
||||
|
||||
@ -240,7 +240,7 @@ goto dk_done
|
||||
|
||||
::pstst $ExecutionContext.SessionState.LanguageMode :pstst
|
||||
|
||||
for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}" %nul6%') do (set tstresult=%%a)
|
||||
for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':pstst';ie%blank%x ($f[1])}" %nul6%') do (set tstresult=%%a)
|
||||
|
||||
if /i not "%tstresult%"=="FullLanguage" (
|
||||
%eline%
|
||||
@ -308,7 +308,9 @@ set terminal=
|
||||
|
||||
if defined terminal (
|
||||
set lines=0
|
||||
for /f "skip=2 tokens=2 delims=: " %%A in ('mode con') do if "!lines!"=="0" set lines=%%A
|
||||
for /f "skip=3 tokens=* delims=" %%A in ('mode con') do if "!lines!"=="0" (
|
||||
for %%B in (%%A) do set lines=%%B
|
||||
)
|
||||
if !lines! GEQ 100 set terminal=
|
||||
)
|
||||
|
||||
@ -661,7 +663,7 @@ echo:
|
||||
%nul% reg delete "HKU\S-1-5-20\%specific_kms%" /f
|
||||
|
||||
%nul% reg query "HKLM\%specific_kms%" && (
|
||||
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':regdel\:.*';iex ($f[1])"
|
||||
%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':regdel\:.*';ie%blank%x ($f[1])"
|
||||
%nul% reg delete "HKLM\%specific_kms%" /f
|
||||
)
|
||||
|
||||
@ -831,7 +833,7 @@ echo Removing the Added Specific KMS Host [Successful]
|
||||
:: Protect KMS38 if opted by the user and conditions are correct
|
||||
|
||||
if defined _k38 (
|
||||
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':regdel\:.*';& ([ScriptBlock]::Create($f[1])) -protect"
|
||||
%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':regdel\:.*';& ([ScriptBlock]::Create($f[1])) -protect"
|
||||
%nul% reg delete "HKLM\%specific_kms%" /f
|
||||
%nul% reg query "HKLM\%specific_kms%" && (
|
||||
echo Protect KMS38 From KMS [Successful] [Locked a Registry Key]
|
||||
@ -875,7 +877,7 @@ title Remove KMS38 Protection %masver%
|
||||
%nul% reg delete "HKU\S-1-5-20\%specific_kms%" /f
|
||||
|
||||
%nul% reg query "HKLM\%specific_kms%" && (
|
||||
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':regdel\:.*';iex ($f[1])"
|
||||
%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':regdel\:.*';ie%blank%x ($f[1])"
|
||||
%nul% reg delete "HKLM\%specific_kms%" /f
|
||||
)
|
||||
|
||||
@ -1016,7 +1018,7 @@ for /f "tokens=3 delims=." %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Con
|
||||
if %_wmic% EQU 1 for /f "tokens=2 delims==" %%a in ('"wmic Path Win32_OperatingSystem Get OperatingSystemSKU /format:LIST" %nul6%') do if not errorlevel 1 set "wmiSKU=%%a"
|
||||
if %_wmic% EQU 0 for /f "tokens=1" %%a in ('%psc% "([WMI]'Win32_OperatingSystem=@').OperatingSystemSKU" %nul6%') do if not errorlevel 1 set "wmiSKU=%%a"
|
||||
|
||||
if %winbuild% GEQ 15063 %psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':winsubstatus\:.*';iex ($f[1])" %nul2% | find /i "Subscription_is_activated" %nul% && (
|
||||
if %winbuild% GEQ 15063 %psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':winsubstatus\:.*';ie%blank%x ($f[1])" %nul2% | find /i "Subscription_is_activated" %nul% && (
|
||||
if defined regSKU if defined slcSKU if not "%regSKU%"=="%slcSKU%" (
|
||||
set winsub=1
|
||||
set osSKU=%regSKU%
|
||||
@ -1490,7 +1492,7 @@ call :dk_color2 %Red% "Checking WinPE " %Blue% "[WinPE
|
||||
|
||||
set wpainfo=
|
||||
set wpaerror=
|
||||
for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':wpatest\:.*';iex ($f[1])" %nul6%') do (set wpainfo=%%a)
|
||||
for /f "delims=" %%a in ('%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':wpatest\:.*';ie%blank%x ($f[1])" %nul6%') do (set wpainfo=%%a)
|
||||
echo "%wpainfo%" | find /i "Error Found" %nul% && (
|
||||
set error=1
|
||||
set wpaerror=1
|
||||
@ -1680,7 +1682,7 @@ set showfix=1
|
||||
if not defined notwinact (
|
||||
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
|
||||
if not defined apps (
|
||||
%psc% "if (-not $env:_vis) {Start-Job { Stop-Service %_slser% -force } | Wait-Job -Timeout 20 | Out-Null}; $sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %nul%
|
||||
%psc% "if (-not $env:_vis) {Start-Job { Stop-Service %_slser% -force } | Wait-Job -Timeout 20 | Out-Null}; $sls = Get-WmiObject SoftwareLicensingService; $f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':xrm\:.*';ie%blank%x ($f[1]); ReinstallLicenses" %nul%
|
||||
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
|
||||
if not defined apps (
|
||||
set "_notfoundids=Key Not Installed / Act ID Not Found"
|
||||
|
@ -1,4 +1,4 @@
|
||||
@set masver=3.3
|
||||
@set masver=3.4
|
||||
@echo off
|
||||
|
||||
|
||||
@ -245,7 +245,7 @@ goto dk_done
|
||||
|
||||
::pstst $ExecutionContext.SessionState.LanguageMode :pstst
|
||||
|
||||
for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}" %nul6%') do (set tstresult=%%a)
|
||||
for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':pstst';ie%blank%x ($f[1])}" %nul6%') do (set tstresult=%%a)
|
||||
|
||||
if /i not "%tstresult%"=="FullLanguage" (
|
||||
%eline%
|
||||
@ -313,7 +313,9 @@ set terminal=
|
||||
|
||||
if defined terminal (
|
||||
set lines=0
|
||||
for /f "skip=2 tokens=2 delims=: " %%A in ('mode con') do if "!lines!"=="0" set lines=%%A
|
||||
for /f "skip=3 tokens=* delims=" %%A in ('mode con') do if "!lines!"=="0" (
|
||||
for %%B in (%%A) do set lines=%%B
|
||||
)
|
||||
if !lines! GEQ 100 set terminal=
|
||||
)
|
||||
|
||||
@ -614,6 +616,7 @@ set error=1
|
||||
goto :starto16c2r
|
||||
)
|
||||
|
||||
call :oh_expiredpreview 2013
|
||||
call :oh_fixprids
|
||||
call :oh_process
|
||||
if defined isOspp (
|
||||
@ -671,6 +674,7 @@ set error=1
|
||||
goto :startmsi
|
||||
)
|
||||
|
||||
call :oh_expiredpreview 2016 2019 2021 2024
|
||||
call :oh_fixprids
|
||||
call :oh_process
|
||||
if defined isOspp (
|
||||
@ -930,6 +934,21 @@ exit /b
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
:oh_expiredpreview
|
||||
|
||||
for %%# in (%*) do (
|
||||
if exist "!_oLPath!\ProPlus%%#PreviewVL_*.xrm-ms" if not exist "!_oLPath!\ProPlus%%#VL_*.xrm-ms" (
|
||||
set error=1
|
||||
set showfix=1
|
||||
call :dk_color %Red% "Checking Expired Preview Products [Office %%# Preview Found]"
|
||||
call :dk_color %Blue% "Please run the Office updates first, and then attempt to activate it again."
|
||||
)
|
||||
)
|
||||
|
||||
exit /b
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
:oh_ppcpath
|
||||
|
||||
if not defined isOspp (
|
||||
@ -1044,7 +1063,7 @@ for %%# in ("!_oLPath!\%_License%*.xrm-ms") do (
|
||||
if defined _arr (set "_arr=!_arr!;"!_oLPath!\%%~nx#"") else (set "_arr="!_oLPath!\%%~nx#"")
|
||||
)
|
||||
|
||||
%psc% "$sls = Get-WmiObject %sps%; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); InstallLicenseArr '!_arr!'; InstallLicenseFile '"!_oLPath!\pkeyconfig-office.xrm-ms"'" %nul%
|
||||
%psc% "$sls = Get-WmiObject %sps%; $f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':xrm\:.*';ie%blank%x ($f[1]); InstallLicenseArr '!_arr!'; InstallLicenseFile '"!_oLPath!\pkeyconfig-office.xrm-ms"'" %nul%
|
||||
|
||||
call :dk_actids 0ff1ce15-a989-479d-af46-f275c6370663
|
||||
echo "!allapps!" | find /i "!_actid!" %nul1% || (
|
||||
@ -1556,8 +1575,8 @@ exit /b
|
||||
:oh_licrefresh
|
||||
|
||||
if exist "%SysPath%\spp\store_test\2.0\tokens.dat" (
|
||||
%psc% "Stop-Service sppsvc -force; $sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %nul%
|
||||
if !errorlevel! NEQ 0 %psc% "$sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %nul%
|
||||
%psc% "Stop-Service sppsvc -force; $sls = Get-WmiObject SoftwareLicensingService; $f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':xrm\:.*';ie%blank%x ($f[1]); ReinstallLicenses" %nul%
|
||||
if !errorlevel! NEQ 0 %psc% "$sls = Get-WmiObject SoftwareLicensingService; $f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':xrm\:.*';ie%blank%x ($f[1]); ReinstallLicenses" %nul%
|
||||
)
|
||||
exit /b
|
||||
|
||||
@ -2008,7 +2027,7 @@ call :dk_color2 %Red% "Checking WinPE " %Blue% "[WinPE
|
||||
|
||||
set wpainfo=
|
||||
set wpaerror=
|
||||
for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':wpatest\:.*';iex ($f[1])" %nul6%') do (set wpainfo=%%a)
|
||||
for /f "delims=" %%a in ('%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':wpatest\:.*';ie%blank%x ($f[1])" %nul6%') do (set wpainfo=%%a)
|
||||
echo "%wpainfo%" | find /i "Error Found" %nul% && (
|
||||
set error=1
|
||||
set wpaerror=1
|
||||
@ -2198,7 +2217,7 @@ set showfix=1
|
||||
if not defined notwinact (
|
||||
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
|
||||
if not defined apps (
|
||||
%psc% "if (-not $env:_vis) {Start-Job { Stop-Service %_slser% -force } | Wait-Job -Timeout 20 | Out-Null}; $sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %nul%
|
||||
%psc% "if (-not $env:_vis) {Start-Job { Stop-Service %_slser% -force } | Wait-Job -Timeout 20 | Out-Null}; $sls = Get-WmiObject SoftwareLicensingService; $f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':xrm\:.*';ie%blank%x ($f[1]); ReinstallLicenses" %nul%
|
||||
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
|
||||
if not defined apps (
|
||||
set "_notfoundids=Key Not Installed / Act ID Not Found"
|
||||
@ -2873,7 +2892,7 @@ exit /b
|
||||
:oh_extractdll
|
||||
|
||||
set b=
|
||||
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':%_hook%\:.*';$encoded = ($f[1]) -replace '-', 'A' -replace '_', 'a';$bytes = [Con%b%vert]::FromBas%b%e64String($encoded); $PePath='%1'; $offset='%2'; $m=[io.file]::ReadAllText('!_batp!') -split ':hexedit\:.*';iex ($m[1])" %nul2% | find /i "Error found" %nul1% && set hasherror=1
|
||||
%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':%_hook%\:.*';$encoded = ($f[1]) -replace '-', 'A' -replace '_', 'a';$bytes = [Con%b%vert]::FromBas%b%e64String($encoded); $PePath='%1'; $offset='%2'; $m=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':hexedit\:.*';ie%blank%x ($m[1])" %nul2% | find /i "Error found" %nul1% && set hasherror=1
|
||||
exit /b
|
||||
|
||||
:hexedit:
|
||||
|
@ -1,4 +1,4 @@
|
||||
@set masver=3.3
|
||||
@set masver=3.4
|
||||
@echo off
|
||||
|
||||
|
||||
@ -276,7 +276,7 @@ goto dk_done
|
||||
|
||||
::pstst $ExecutionContext.SessionState.LanguageMode :pstst
|
||||
|
||||
for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}" %nul6%') do (set tstresult=%%a)
|
||||
for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':pstst';ie%blank%x ($f[1])}" %nul6%') do (set tstresult=%%a)
|
||||
|
||||
if /i not "%tstresult%"=="FullLanguage" (
|
||||
%eline%
|
||||
@ -344,7 +344,9 @@ set terminal=
|
||||
|
||||
if defined terminal (
|
||||
set lines=0
|
||||
for /f "skip=2 tokens=2 delims=: " %%A in ('mode con') do if "!lines!"=="0" set lines=%%A
|
||||
for /f "skip=3 tokens=* delims=" %%A in ('mode con') do if "!lines!"=="0" (
|
||||
for %%B in (%%A) do set lines=%%B
|
||||
)
|
||||
if !lines! GEQ 100 set terminal=
|
||||
)
|
||||
|
||||
@ -876,6 +878,7 @@ set error=1
|
||||
goto :ks_starto16c2r
|
||||
)
|
||||
|
||||
call :oh_expiredpreview 2013
|
||||
if "%_actprojvis%"=="0" call :oh_fixprids
|
||||
call :ks_process
|
||||
|
||||
@ -916,6 +919,7 @@ set error=1
|
||||
goto :ks_startmsi
|
||||
)
|
||||
|
||||
call :oh_expiredpreview 2016 2019 2021 2024
|
||||
if "%_actprojvis%"=="0" call :oh_fixprids
|
||||
call :ks_process
|
||||
|
||||
@ -1096,6 +1100,21 @@ exit /b
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
:oh_expiredpreview
|
||||
|
||||
for %%# in (%*) do (
|
||||
if exist "!_oLPath!\ProPlus%%#PreviewVL_*.xrm-ms" if not exist "!_oLPath!\ProPlus%%#VL_*.xrm-ms" (
|
||||
set error=1
|
||||
set showfix=1
|
||||
call :dk_color %Red% "Checking Expired Preview Products [Office %%# Preview Found]"
|
||||
call :dk_color %Blue% "Please run the Office updates first, and then attempt to activate it again."
|
||||
)
|
||||
)
|
||||
|
||||
exit /b
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
:: Some Office Retail to Volume converter tools may edit the ProductReleaseIds to add VL products. This code restores it because it may affect features.
|
||||
|
||||
:oh_fixprids
|
||||
@ -1329,7 +1348,7 @@ for %%# in ("!_oLPath!\%_License%*.xrm-ms") do (
|
||||
if defined _arr (set "_arr=!_arr!;"!_oLPath!\%%~nx#"") else (set "_arr="!_oLPath!\%%~nx#"")
|
||||
)
|
||||
|
||||
%psc% "$sls = Get-WmiObject %sps%; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); InstallLicenseArr '!_arr!'; InstallLicenseFile '"!_oLPath!\pkeyconfig-office.xrm-ms"'" %nul%
|
||||
%psc% "$sls = Get-WmiObject %sps%; $f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':xrm\:.*';ie%blank%x ($f[1]); InstallLicenseArr '!_arr!'; InstallLicenseFile '"!_oLPath!\pkeyconfig-office.xrm-ms"'" %nul%
|
||||
|
||||
call :dk_actids 0ff1ce15-a989-479d-af46-f275c6370663
|
||||
echo "!allapps!" | find /i "!_actid!" %nul1% || (
|
||||
@ -1534,8 +1553,8 @@ exit /b
|
||||
:oh_licrefresh
|
||||
|
||||
if exist "%SysPath%\spp\store_test\2.0\tokens.dat" (
|
||||
%psc% "Stop-Service sppsvc -force; $sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %nul%
|
||||
if !errorlevel! NEQ 0 %psc% "$sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %nul%
|
||||
%psc% "Stop-Service sppsvc -force; $sls = Get-WmiObject SoftwareLicensingService; $f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':xrm\:.*';ie%blank%x ($f[1]); ReinstallLicenses" %nul%
|
||||
if !errorlevel! NEQ 0 %psc% "$sls = Get-WmiObject SoftwareLicensingService; $f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':xrm\:.*';ie%blank%x ($f[1]); ReinstallLicenses" %nul%
|
||||
)
|
||||
exit /b
|
||||
|
||||
@ -2137,8 +2156,8 @@ set srvlist=
|
||||
set -=
|
||||
|
||||
set "srvlist=kms.03%-%k.org kms-default.cangs%-%hui.net kms.six%-%yin.com kms.moe%-%club.org kms.cgt%-%soft.com"
|
||||
set "srvlist=%srvlist% kms.id%-%ina.cn kms.moe%-%yuuko.com xinch%-%eng213618.cn kms.lol%-%i.best kms.my%-%ds.cloud"
|
||||
set "srvlist=%srvlist% kms.0%-%t.net.cn win.k%-%ms.pub kms.wx%-%lost.com kms.moe%-%yuuko.top kms.gh%-%pym.com"
|
||||
set "srvlist=%srvlist% kms.id%-%ina.cn kms.moe%-%yuuko.com xinch%-%eng213618.cn kms.lol%-%i.best kms.mc%-%06.net"
|
||||
set "srvlist=%srvlist% kms.0%-%t.net.cn win.k%-%ms.pub kms.wx%-%lost.com kms.moe%-%yuuko.top kms.gh%-%xi.com"
|
||||
|
||||
set n=1
|
||||
for %%a in (%srvlist%) do (set %%a=&set server!n!=%%a&set /a n+=1)
|
||||
@ -2197,7 +2216,7 @@ if not defined _int (s%nil%cht%nil%asks /cre%nil%ate /tn "Activation-Run_Once" /
|
||||
if exist "%_temp%\.*" rmdir /s /q "%_temp%\" %nul%
|
||||
|
||||
call :ks_createInfo.txt
|
||||
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split \":_extracttask\:.*`r`n\"; [io.file]::WriteAllText('%_dest%\Activation_task.cmd', '@::%randguid%' + [Environment]::NewLine + $f[1].Trim(), [System.Text.Encoding]::ASCII)"
|
||||
%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit \":_extracttask\:.*`r`n\"; [io.file]::WriteAllText('%_dest%\Activation_task.cmd', '@::%randguid%' + [Environment]::NewLine + $f[1].Trim(), [System.Text.Encoding]::ASCII)"
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
@ -2227,7 +2246,7 @@ exit /b
|
||||
|
||||
:ks_RenExport
|
||||
|
||||
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split \":%~1\:.*`r`n\"; [io.file]::WriteAllText('%~2',$f[1].Trim(),[System.Text.Encoding]::%~3);"
|
||||
%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit \":%~1\:.*`r`n\"; [io.file]::WriteAllText('%~2',$f[1].Trim(),[System.Text.Encoding]::%~3);"
|
||||
exit /b
|
||||
|
||||
::========================================================================================================================================
|
||||
@ -2593,7 +2612,7 @@ for /f "tokens=3 delims=." %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Con
|
||||
if %_wmic% EQU 1 for /f "tokens=2 delims==" %%a in ('"wmic Path Win32_OperatingSystem Get OperatingSystemSKU /format:LIST" %nul6%') do if not errorlevel 1 set "wmiSKU=%%a"
|
||||
if %_wmic% EQU 0 for /f "tokens=1" %%a in ('%psc% "([WMI]'Win32_OperatingSystem=@').OperatingSystemSKU" %nul6%') do if not errorlevel 1 set "wmiSKU=%%a"
|
||||
|
||||
if %winbuild% GEQ 15063 %psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':winsubstatus\:.*';iex ($f[1])" %nul2% | find /i "Subscription_is_activated" %nul% && (
|
||||
if %winbuild% GEQ 15063 %psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':winsubstatus\:.*';ie%blank%x ($f[1])" %nul2% | find /i "Subscription_is_activated" %nul% && (
|
||||
if defined regSKU if defined slcSKU if not "%regSKU%"=="%slcSKU%" (
|
||||
set winsub=1
|
||||
set osSKU=%regSKU%
|
||||
@ -3064,7 +3083,7 @@ call :dk_color2 %Red% "Checking WinPE " %Blue% "[WinPE
|
||||
|
||||
set wpainfo=
|
||||
set wpaerror=
|
||||
for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':wpatest\:.*';iex ($f[1])" %nul6%') do (set wpainfo=%%a)
|
||||
for /f "delims=" %%a in ('%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':wpatest\:.*';ie%blank%x ($f[1])" %nul6%') do (set wpainfo=%%a)
|
||||
echo "%wpainfo%" | find /i "Error Found" %nul% && (
|
||||
set error=1
|
||||
set wpaerror=1
|
||||
@ -3254,7 +3273,7 @@ set showfix=1
|
||||
if not defined notwinact (
|
||||
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
|
||||
if not defined apps (
|
||||
%psc% "if (-not $env:_vis) {Start-Job { Stop-Service %_slser% -force } | Wait-Job -Timeout 20 | Out-Null}; $sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %nul%
|
||||
%psc% "if (-not $env:_vis) {Start-Job { Stop-Service %_slser% -force } | Wait-Job -Timeout 20 | Out-Null}; $sls = Get-WmiObject SoftwareLicensingService; $f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':xrm\:.*';ie%blank%x ($f[1]); ReinstallLicenses" %nul%
|
||||
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
|
||||
if not defined apps (
|
||||
set "_notfoundids=Key Not Installed / Act ID Not Found"
|
||||
|
@ -1,4 +1,4 @@
|
||||
@set masver=3.3
|
||||
@set masver=3.4
|
||||
@echo off
|
||||
|
||||
|
||||
@ -303,7 +303,7 @@ goto dk_done
|
||||
|
||||
::pstst $ExecutionContext.SessionState.LanguageMode :pstst
|
||||
|
||||
for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}" %nul6%') do (set tstresult=%%a)
|
||||
for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':pstst';ie%blank%x ($f[1])}" %nul6%') do (set tstresult=%%a)
|
||||
|
||||
if /i not "%tstresult%"=="FullLanguage" (
|
||||
%eline%
|
||||
@ -371,7 +371,9 @@ set terminal=
|
||||
|
||||
if defined terminal (
|
||||
set lines=0
|
||||
for /f "skip=2 tokens=2 delims=: " %%A in ('mode con') do if "!lines!"=="0" set lines=%%A
|
||||
for /f "skip=3 tokens=* delims=" %%A in ('mode con') do if "!lines!"=="0" (
|
||||
for %%B in (%%A) do set lines=%%B
|
||||
)
|
||||
if !lines! GEQ 100 set terminal=
|
||||
)
|
||||
|
||||
@ -497,6 +499,8 @@ if !_el!==1 cls & setlocal & set "_actwin=1" & call :ts_start & endlocal
|
||||
goto :ts_menu
|
||||
)
|
||||
|
||||
goto :ts_start
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
:ts_changemethod
|
||||
@ -509,25 +513,26 @@ echo:
|
||||
echo:
|
||||
echo ______________________________________________________________
|
||||
echo:
|
||||
call :dk_color2 %_White% " [1] " %_Green% " Auto"
|
||||
echo Build 19041 and later:
|
||||
echo Uses StaticCID, or KMS4k if offline.
|
||||
echo Older builds: Uses ZeroCID.
|
||||
echo _______________________________________________
|
||||
call :dk_color2 %_White% " [1] " %_Green% "Auto"
|
||||
echo Builds ^>= 19041 - StaticCID (KMS4k if offline)
|
||||
echo Builds ^< 19041 - ZeroCID
|
||||
echo __________________________________________________
|
||||
echo:
|
||||
echo [2] StaticCID
|
||||
echo Needs Internet.
|
||||
echo Not for Windows 7 or older.
|
||||
echo _______________________________________________
|
||||
echo Needs Internet
|
||||
echo Not for Windows 7 or older
|
||||
echo __________________________________________________
|
||||
echo:
|
||||
echo [3] ZeroCID
|
||||
echo Works only on builds below 19041.
|
||||
echo _______________________________________________
|
||||
echo Works reliably on builds below 19041
|
||||
echo May break on builds between 19041-26100
|
||||
echo Does not work on builds above 26100.4188
|
||||
echo __________________________________________________
|
||||
echo:
|
||||
echo [4] KMS4k
|
||||
echo This applies only to volume products.
|
||||
echo Activates for 4000+ years using KMS.
|
||||
echo _______________________________________________
|
||||
echo Volume licenses only
|
||||
echo Activates for 4000+ years
|
||||
echo __________________________________________________
|
||||
echo:
|
||||
echo [5] Learn More
|
||||
echo [0] %_exitmsg%
|
||||
@ -666,7 +671,7 @@ echo Checking Internet Connection [Connected!ping_f!]
|
||||
if /i %_actmethod%==Auto if not %_actman%==1 set tsmethod=KMS4k
|
||||
if /i !tsmethod!==KMS4k (
|
||||
call :dk_color %Gray% "Checking Internet Connection [Not Connected]"
|
||||
call :dk_color %Blue% "Switching To KMS4k Activation Method because Internet is needed for StaticCID method."
|
||||
call :dk_color %Blue% "Switching To KMS4k method because Internet is needed for StaticCID method."
|
||||
) else (
|
||||
set error=1
|
||||
call :dk_color %Red% "Checking Internet Connection [Not Connected]"
|
||||
@ -738,7 +743,7 @@ if defined _vis goto :ts_winvista
|
||||
|
||||
set tempid=
|
||||
if /i %tsmethod%==KMS4k (set keytype=ks) else (set keytype=zero)
|
||||
for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':wintsid\:.*';iex ($f[1])" %nul6%') do (
|
||||
for /f "delims=" %%a in ('%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':wintsid\:.*';ie%blank%x ($f[1])" %nul6%') do (
|
||||
echo "%%a" | findstr /r ".*-.*-.*-.*-.*" %nul1% && (set tsids=!tsids! %%a& set tempid=%%a)
|
||||
)
|
||||
|
||||
@ -1028,7 +1033,7 @@ goto :ts_esu
|
||||
)
|
||||
|
||||
set resetstuff=1
|
||||
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':tsforge\:.*';iex ($f[1])"
|
||||
%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':tsforge\:.*';ie%blank%x ($f[1])"
|
||||
set resetstuff=
|
||||
if !errorlevel!==3 (
|
||||
set error=1
|
||||
@ -1377,6 +1382,7 @@ set error=1
|
||||
goto :ts_starto16c2r
|
||||
)
|
||||
|
||||
call :oh_expiredpreview 2013
|
||||
if "%_actprojvis%"=="0" call :oh_fixprids
|
||||
call :ts_process
|
||||
|
||||
@ -1418,6 +1424,7 @@ set error=1
|
||||
goto :ts_startmsi
|
||||
)
|
||||
|
||||
call :oh_expiredpreview 2016 2019 2021 2024
|
||||
if "%_actprojvis%"=="0" call :oh_fixprids
|
||||
call :ts_process
|
||||
|
||||
@ -1501,10 +1508,10 @@ if %winbuild% GEQ 10586 (
|
||||
for %%# in ("%SysPath%\spp\tokens\skus\%tsedition%\*CSVLK*.xrm-ms") do (
|
||||
if defined _arr (set "_arr=!_arr!;"%SysPath%\spp\tokens\skus\%tsedition%\%%~nx#"") else (set "_arr="%SysPath%\spp\tokens\skus\%tsedition%\%%~nx#"")
|
||||
)
|
||||
if defined _arr %psc% "$sls = Get-WmiObject %sps%; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); InstallLicenseArr '!_arr!'" %nul%
|
||||
if defined _arr %psc% "$sls = Get-WmiObject %sps%; $f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':xrm\:.*';ie%blank%x ($f[1]); InstallLicenseArr '!_arr!'" %nul%
|
||||
)
|
||||
|
||||
for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':wintsid\:.*';iex ($f[1])" %nul6%') do (
|
||||
for /f "delims=" %%a in ('%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':wintsid\:.*';ie%blank%x ($f[1])" %nul6%') do (
|
||||
echo "%%a" | findstr /r ".*-.*-.*-.*-.*" %nul1% && (set tsids=!tsids! %%a& set tempid=%%a)
|
||||
)
|
||||
|
||||
@ -1698,7 +1705,7 @@ echo Processing Reset of Rearm / Timers / Tamper / Lock...
|
||||
echo:
|
||||
|
||||
set resetstuff=1
|
||||
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':tsforge\:.*';iex ($f[1])"
|
||||
%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':tsforge\:.*';ie%blank%x ($f[1])"
|
||||
|
||||
if %errorlevel%==3 (
|
||||
call :dk_color %Red% "Reset Failed."
|
||||
@ -1746,7 +1753,7 @@ if %errorlevel%==1 exit /b
|
||||
echo:
|
||||
echo Fetching Supported Activation IDs list. Please wait...
|
||||
|
||||
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':listactids\:.*';iex ($f[1])"
|
||||
%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':listactids\:.*';ie%blank%x ($f[1])"
|
||||
if %errorlevel%==3 (
|
||||
call :dk_color %Gray% "No supported activation ID found, aborting..."
|
||||
goto :dk_done
|
||||
@ -1895,7 +1902,7 @@ echo Writing TrustedStore data...
|
||||
if /i %tsmethod%==StaticCID (echo Depositing Static Confirmation ID...) else (echo Depositing Zero Confirmation ID...)
|
||||
)
|
||||
echo:
|
||||
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':tsforge\:.*';& ([ScriptBlock]::Create($f[1])) %tsids%"
|
||||
%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':tsforge\:.*';& ([ScriptBlock]::Create($f[1])) %tsids%"
|
||||
if !errorlevel!==3 (
|
||||
if %_actman%==0 (if not defined error call :dk_color %Blue% "%_fixmsg%")
|
||||
set fixes=%fixes% %mas%troubleshoot
|
||||
@ -1999,6 +2006,21 @@ exit /b
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
:oh_expiredpreview
|
||||
|
||||
for %%# in (%*) do (
|
||||
if exist "!_oLPath!\ProPlus%%#PreviewVL_*.xrm-ms" if not exist "!_oLPath!\ProPlus%%#VL_*.xrm-ms" (
|
||||
set error=1
|
||||
set showfix=1
|
||||
call :dk_color %Red% "Checking Expired Preview Products [Office %%# Preview Found]"
|
||||
call :dk_color %Blue% "Please run the Office updates first, and then attempt to activate it again."
|
||||
)
|
||||
)
|
||||
|
||||
exit /b
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
:: Some Office Retail to Volume converter tools may edit the ProductReleaseIds to add VL products. This code restores it because it may affect features.
|
||||
|
||||
:oh_fixprids
|
||||
@ -2149,7 +2171,7 @@ echo !_License! | find /i "Retail" %nul% && (set keytype=zero) || (set keytype=k
|
||||
set keytype=zero
|
||||
)
|
||||
|
||||
for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':offtsid\:.*';iex ($f[1])" %nul6%') do (
|
||||
for /f "delims=" %%a in ('%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':offtsid\:.*';ie%blank%x ($f[1])" %nul6%') do (
|
||||
echo "%%a" | findstr /r ".*-.*-.*-.*-.*" %nul1% && (set tsids=!tsids! %%a& set _actid=%%a)
|
||||
)
|
||||
set "_allactid=!tsids!"
|
||||
@ -2270,7 +2292,7 @@ for %%# in ("!_oLPath!\%_License%*.xrm-ms") do (
|
||||
if defined _arr (set "_arr=!_arr!;"!_oLPath!\%%~nx#"") else (set "_arr="!_oLPath!\%%~nx#"")
|
||||
)
|
||||
|
||||
%psc% "$sls = Get-WmiObject %sps%; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); InstallLicenseArr '!_arr!'; InstallLicenseFile '"!_oLPath!\pkeyconfig-office.xrm-ms"'" %nul%
|
||||
%psc% "$sls = Get-WmiObject %sps%; $f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':xrm\:.*';ie%blank%x ($f[1]); InstallLicenseArr '!_arr!'; InstallLicenseFile '"!_oLPath!\pkeyconfig-office.xrm-ms"'" %nul%
|
||||
|
||||
call :dk_actids 0ff1ce15-a989-479d-af46-f275c6370663
|
||||
echo "!allapps!" | find /i "!_actid!" %nul1% || (
|
||||
@ -2475,8 +2497,8 @@ exit /b
|
||||
:oh_licrefresh
|
||||
|
||||
if exist "%SysPath%\spp\store_test\2.0\tokens.dat" (
|
||||
%psc% "Stop-Service sppsvc -force; $sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %nul%
|
||||
if !errorlevel! NEQ 0 %psc% "$sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %nul%
|
||||
%psc% "Stop-Service sppsvc -force; $sls = Get-WmiObject SoftwareLicensingService; $f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':xrm\:.*';ie%blank%x ($f[1]); ReinstallLicenses" %nul%
|
||||
if !errorlevel! NEQ 0 %psc% "$sls = Get-WmiObject SoftwareLicensingService; $f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':xrm\:.*';ie%blank%x ($f[1]); ReinstallLicenses" %nul%
|
||||
)
|
||||
exit /b
|
||||
|
||||
@ -2631,7 +2653,7 @@ for /f "tokens=3 delims=." %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Con
|
||||
if %_wmic% EQU 1 for /f "tokens=2 delims==" %%a in ('"wmic Path Win32_OperatingSystem Get OperatingSystemSKU /format:LIST" %nul6%') do if not errorlevel 1 set "wmiSKU=%%a"
|
||||
if %_wmic% EQU 0 for /f "tokens=1" %%a in ('%psc% "([WMI]'Win32_OperatingSystem=@').OperatingSystemSKU" %nul6%') do if not errorlevel 1 set "wmiSKU=%%a"
|
||||
|
||||
if %winbuild% GEQ 15063 %psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':winsubstatus\:.*';iex ($f[1])" %nul2% | find /i "Subscription_is_activated" %nul% && (
|
||||
if %winbuild% GEQ 15063 %psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':winsubstatus\:.*';ie%blank%x ($f[1])" %nul2% | find /i "Subscription_is_activated" %nul% && (
|
||||
if defined regSKU if defined slcSKU if not "%regSKU%"=="%slcSKU%" (
|
||||
set winsub=1
|
||||
set osSKU=%regSKU%
|
||||
@ -3059,7 +3081,7 @@ call :dk_color2 %Red% "Checking WinPE " %Blue% "[WinPE
|
||||
|
||||
set wpainfo=
|
||||
set wpaerror=
|
||||
for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':wpatest\:.*';iex ($f[1])" %nul6%') do (set wpainfo=%%a)
|
||||
for /f "delims=" %%a in ('%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':wpatest\:.*';ie%blank%x ($f[1])" %nul6%') do (set wpainfo=%%a)
|
||||
echo "%wpainfo%" | find /i "Error Found" %nul% && (
|
||||
set error=1
|
||||
set wpaerror=1
|
||||
@ -3249,7 +3271,7 @@ set showfix=1
|
||||
if not defined notwinact (
|
||||
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
|
||||
if not defined apps (
|
||||
%psc% "if (-not $env:_vis) {Start-Job { Stop-Service %_slser% -force } | Wait-Job -Timeout 20 | Out-Null}; $sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %nul%
|
||||
%psc% "if (-not $env:_vis) {Start-Job { Stop-Service %_slser% -force } | Wait-Job -Timeout 20 | Out-Null}; $sls = Get-WmiObject SoftwareLicensingService; $f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':xrm\:.*';ie%blank%x ($f[1]); ReinstallLicenses" %nul%
|
||||
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
|
||||
if not defined apps (
|
||||
set "_notfoundids=Key Not Installed / Act ID Not Found"
|
||||
|
@ -1,4 +1,4 @@
|
||||
@set masver=3.3
|
||||
@set masver=3.4
|
||||
@echo off
|
||||
|
||||
|
||||
@ -190,7 +190,7 @@ goto dk_done
|
||||
|
||||
::pstst $ExecutionContext.SessionState.LanguageMode :pstst
|
||||
|
||||
for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}" %nul6%') do (set tstresult=%%a)
|
||||
for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':pstst';ie%blank%x ($f[1])}" %nul6%') do (set tstresult=%%a)
|
||||
|
||||
if /i not "%tstresult%"=="FullLanguage" (
|
||||
%eline%
|
||||
@ -258,7 +258,9 @@ set terminal=
|
||||
|
||||
if defined terminal (
|
||||
set lines=0
|
||||
for /f "skip=2 tokens=2 delims=: " %%A in ('mode con') do if "!lines!"=="0" set lines=%%A
|
||||
for /f "skip=3 tokens=* delims=" %%A in ('mode con') do if "!lines!"=="0" (
|
||||
for %%B in (%%A) do set lines=%%B
|
||||
)
|
||||
if !lines! GEQ 100 set terminal=
|
||||
)
|
||||
|
||||
@ -545,7 +547,7 @@ goto :oe_edition
|
||||
cls
|
||||
call :ch_getinfo
|
||||
call :oe_tempcleanup
|
||||
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':getlist\:.*';iex ($f[1])"
|
||||
%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':getlist\:.*';ie%blank%x ($f[1])"
|
||||
|
||||
:oe_editionchange
|
||||
|
||||
@ -619,7 +621,7 @@ cls
|
||||
set suites=
|
||||
echo %list% | find /i "Suites" %nul1% && (
|
||||
set suites=1
|
||||
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':getappnames\:.*';iex ($f[1])"
|
||||
%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':getappnames\:.*';ie%blank%x ($f[1])"
|
||||
if not exist %SystemRoot%\Temp\getAppIds.txt (
|
||||
%eline%
|
||||
echo Failed to generate available apps list.
|
||||
@ -1100,7 +1102,7 @@ if not defined terminal mode 105, 32
|
||||
:: Get build number for the target FFN, using build number with OfficeC2RClient.exe command to trigger updates provides accurate results
|
||||
|
||||
set build=
|
||||
for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':getbuild\:.*';iex ($f[1])" %nul6%') do (set build=%%a)
|
||||
for /f "delims=" %%a in ('%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':getbuild\:.*';ie%blank%x ($f[1])" %nul6%') do (set build=%%a)
|
||||
echo "%build%" | find /i "16." %nul% || set build=
|
||||
|
||||
echo:
|
||||
|
@ -1,4 +1,4 @@
|
||||
@set masver=3.3
|
||||
@set masver=3.4
|
||||
@echo off
|
||||
|
||||
|
||||
@ -195,7 +195,7 @@ goto dk_done
|
||||
|
||||
::pstst $ExecutionContext.SessionState.LanguageMode :pstst
|
||||
|
||||
for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}" %nul6%') do (set tstresult=%%a)
|
||||
for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':pstst';ie%blank%x ($f[1])}" %nul6%') do (set tstresult=%%a)
|
||||
|
||||
if /i not "%tstresult%"=="FullLanguage" (
|
||||
%eline%
|
||||
@ -263,7 +263,9 @@ set terminal=
|
||||
|
||||
if defined terminal (
|
||||
set lines=0
|
||||
for /f "skip=2 tokens=2 delims=: " %%A in ('mode con') do if "!lines!"=="0" set lines=%%A
|
||||
for /f "skip=3 tokens=* delims=" %%A in ('mode con') do if "!lines!"=="0" (
|
||||
for %%B in (%%A) do set lines=%%B
|
||||
)
|
||||
if !lines! GEQ 100 set terminal=
|
||||
)
|
||||
|
||||
@ -445,7 +447,7 @@ set _ntarget=
|
||||
set _wtarget=
|
||||
|
||||
if %winbuild% GEQ 10240 for /f "tokens=4" %%a in ('dism /online /english /Get-TargetEditions ^| findstr /i /c:"Target Edition : "') do (if defined _dtarget (set "_dtarget= !_dtarget! %%a ") else (set "_dtarget= %%a "))
|
||||
if %winbuild% LSS 10240 for /f "tokens=4" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':cbsxml\:.*';& ([ScriptBlock]::Create($f[1])) -GetTargetEditions;" ^| findstr /i /c:"Target Edition : "') do (if defined _ptarget (set "_ptarget= !_ptarget! %%a ") else (set "_ptarget= %%a "))
|
||||
if %winbuild% LSS 10240 for /f "tokens=4" %%a in ('%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':cbsxml\:.*';& ([ScriptBlock]::Create($f[1])) -GetTargetEditions;" ^| findstr /i /c:"Target Edition : "') do (if defined _ptarget (set "_ptarget= !_ptarget! %%a ") else (set "_ptarget= %%a "))
|
||||
|
||||
if %winbuild% GEQ 10240 if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*Edition~*.mum" (
|
||||
if %winbuild% GEQ 17063 call :ced_edilist
|
||||
@ -651,7 +653,7 @@ echo:
|
||||
call :ced_prep
|
||||
if defined preperror goto dk_done
|
||||
|
||||
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':dismapi\:.*';& ([ScriptBlock]::Create($f[1])) %targetedition% %key%"
|
||||
%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':dismapi\:.*';& ([ScriptBlock]::Create($f[1])) %targetedition% %key%"
|
||||
call :ced_postprep
|
||||
)
|
||||
%line%
|
||||
@ -689,7 +691,7 @@ call :ced_prep
|
||||
if defined preperror goto dk_done
|
||||
|
||||
if %_stg%==0 (set stage=) else (set stage=-StageCurrent)
|
||||
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':cbsxml\:.*';& ([ScriptBlock]::Create($f[1])) -SetEdition %targetedition% %stage%"
|
||||
%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':cbsxml\:.*';& ([ScriptBlock]::Create($f[1])) -SetEdition %targetedition% %stage%"
|
||||
call :ced_postprep
|
||||
%line%
|
||||
|
||||
|
@ -23,6 +23,7 @@ set "Path=%SystemRoot%\Sysnative;%SystemRoot%;%SystemRoot%\Sysnative\Wbem;%Syste
|
||||
set "ComSpec=%SysPath%\cmd.exe"
|
||||
set "PSModulePath=%ProgramFiles%\WindowsPowerShell\Modules;%SysPath%\WindowsPowerShell\v1.0\Modules"
|
||||
|
||||
set "blank="
|
||||
set "ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe"
|
||||
set "_psc=%ps% -nop -c"
|
||||
set "_err===== ERROR ===="
|
||||
@ -39,7 +40,7 @@ goto :E_Exit
|
||||
set "_batf=%~f0"
|
||||
set "_batp=%_batf:'=''%"
|
||||
setlocal EnableDelayedExpansion
|
||||
%_psc% "$f=[IO.File]::ReadAllText('!_batp!') -split ':sppmgr\:.*';iex ($f[1])"
|
||||
%_psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':sppmgr\:.*';ie%blank%x ($f[1])"
|
||||
|
||||
:E_Exit
|
||||
echo.
|
||||
|
@ -1,4 +1,4 @@
|
||||
@set masver=3.3
|
||||
@set masver=3.4
|
||||
@echo off
|
||||
|
||||
|
||||
@ -206,7 +206,7 @@ goto done2
|
||||
|
||||
::pstst $ExecutionContext.SessionState.LanguageMode :pstst
|
||||
|
||||
for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}" %nul6%') do (set tstresult=%%a)
|
||||
for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':pstst';ie%blank%x ($f[1])}" %nul6%') do (set tstresult=%%a)
|
||||
|
||||
if /i not "%tstresult%"=="FullLanguage" (
|
||||
%eline%
|
||||
@ -274,7 +274,9 @@ set terminal=
|
||||
|
||||
if defined terminal (
|
||||
set lines=0
|
||||
for /f "skip=2 tokens=2 delims=: " %%A in ('mode con') do if "!lines!"=="0" set lines=%%A
|
||||
for /f "skip=3 tokens=* delims=" %%A in ('mode con') do if "!lines!"=="0" (
|
||||
for %%B in (%%A) do set lines=%%B
|
||||
)
|
||||
if !lines! GEQ 100 set terminal=
|
||||
)
|
||||
|
||||
@ -816,7 +818,7 @@ exit /b
|
||||
|
||||
:export
|
||||
|
||||
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split \":%~1\:.*`r`n\"; [io.file]::WriteAllText('!_pdesk!\$OEM$\$$\Setup\Scripts\SetupComplete.cmd',$f[1].Trim(),[System.Text.Encoding]::ASCII);"
|
||||
%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit \":%~1\:.*`r`n\"; [io.file]::WriteAllText('!_pdesk!\$OEM$\$$\Setup\Scripts\SetupComplete.cmd',$f[1].Trim(),[System.Text.Encoding]::ASCII);"
|
||||
exit /b
|
||||
|
||||
::========================================================================================================================================
|
||||
|
@ -1,4 +1,4 @@
|
||||
@set masver=3.3
|
||||
@set masver=3.4
|
||||
@echo off
|
||||
|
||||
|
||||
@ -207,7 +207,7 @@ goto dk_done
|
||||
|
||||
::pstst $ExecutionContext.SessionState.LanguageMode :pstst
|
||||
|
||||
for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}" %nul6%') do (set tstresult=%%a)
|
||||
for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':pstst';ie%blank%x ($f[1])}" %nul6%') do (set tstresult=%%a)
|
||||
|
||||
if /i not "%tstresult%"=="FullLanguage" (
|
||||
%eline%
|
||||
@ -275,7 +275,9 @@ set terminal=
|
||||
|
||||
if defined terminal (
|
||||
set lines=0
|
||||
for /f "skip=2 tokens=2 delims=: " %%A in ('mode con') do if "!lines!"=="0" set lines=%%A
|
||||
for /f "skip=3 tokens=* delims=" %%A in ('mode con') do if "!lines!"=="0" (
|
||||
for %%B in (%%A) do set lines=%%B
|
||||
)
|
||||
if !lines! GEQ 100 set terminal=
|
||||
)
|
||||
|
||||
@ -716,7 +718,7 @@ echo Checking SPP permission related issues...
|
||||
call :checkperms
|
||||
if defined permerror (
|
||||
call :dk_color %Red% "[!permerror!]"
|
||||
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':fixsppperms\:.*';iex ($f[1])" %nul%
|
||||
%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':fixsppperms\:.*';ie%blank%x ($f[1])" %nul%
|
||||
call :checkperms
|
||||
if defined permerror (
|
||||
call :dk_color %Red% "[!permerror!] [Failed To Fix]"
|
||||
@ -786,8 +788,8 @@ if defined _vis (
|
||||
|
||||
echo:
|
||||
echo Reinstalling system licenses...
|
||||
%psc% "$sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %nul%
|
||||
if %errorlevel% NEQ 0 %psc% "$sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %nul%
|
||||
%psc% "$sls = Get-WmiObject SoftwareLicensingService; $f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':xrm\:.*';ie%blank%x ($f[1]); ReinstallLicenses" %nul%
|
||||
if %errorlevel% NEQ 0 %psc% "$sls = Get-WmiObject SoftwareLicensingService; $f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':xrm\:.*';ie%blank%x ($f[1]); ReinstallLicenses" %nul%
|
||||
if %errorlevel% EQU 0 (
|
||||
echo [Successful]
|
||||
) else (
|
||||
@ -1433,7 +1435,7 @@ exit /b
|
||||
|
||||
:regownstart
|
||||
|
||||
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':regown\:.*';iex ($f[1]);"
|
||||
%psc% "$f=[io.f%blank%ile]::ReadA%blank%llText('!_batp!') -sp%blank%lit ':regown\:.*';ie%blank%x ($f[1]);"
|
||||
exit /b
|
||||
|
||||
:: Below code takes ownership of a volatile registry key and deletes it
|
||||
|
Reference in New Issue
Block a user