|
|
|
@ -312,7 +312,7 @@ goto dk_done |
|
|
|
|
|
|
|
|
|
|
|
::pstst $ExecutionContext.SessionState.LanguageMode :pstst |
|
|
|
::pstst $ExecutionContext.SessionState.LanguageMode :pstst |
|
|
|
|
|
|
|
|
|
|
|
for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[System.IO.File]::ReadAllText('!_batp!') -split ':pstst';. ([scriptblock]::Create($f[1]))}" %nul6%') do (set tstresult=%%a) |
|
|
|
for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[IO.File]::ReadAllText('!_batp!') -split ':pstst';. ([scriptblock]::Create($f[1]))}" %nul6%') do (set tstresult=%%a) |
|
|
|
|
|
|
|
|
|
|
|
if /i not "%tstresult%"=="FullLanguage" ( |
|
|
|
if /i not "%tstresult%"=="FullLanguage" ( |
|
|
|
%eline% |
|
|
|
%eline% |
|
|
|
@ -763,7 +763,7 @@ if defined _vis goto :ts_winvista |
|
|
|
|
|
|
|
|
|
|
|
set tempid= |
|
|
|
set tempid= |
|
|
|
if /i %tsmethod%==KMS4k (set keytype=ks) else (set keytype=zero) |
|
|
|
if /i %tsmethod%==KMS4k (set keytype=ks) else (set keytype=zero) |
|
|
|
for /f "delims=" %%a in ('%psc% "$f=[System.IO.File]::ReadAllText('!_batp!') -split ':wintsid\:.*';. ([scriptblock]::Create($f[1]))" %nul6%') do ( |
|
|
|
for /f "delims=" %%a in ('%psc% "$f=[IO.File]::ReadAllText('!_batp!') -split ':wintsid\:.*';. ([scriptblock]::Create($f[1]))" %nul6%') do ( |
|
|
|
echo "%%a" | findstr /r ".*-.*-.*-.*-.*" %nul1% && (set tsids=!tsids! %%a& set tempid=%%a) |
|
|
|
echo "%%a" | findstr /r ".*-.*-.*-.*-.*" %nul1% && (set tsids=!tsids! %%a& set tempid=%%a) |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
@ -1053,7 +1053,7 @@ goto :ts_esu |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
set resetstuff=1 |
|
|
|
set resetstuff=1 |
|
|
|
%psc% "$f=[System.IO.File]::ReadAllText('!_batp!') -split ':tsforge\:.*';. ([scriptblock]::Create($f[1]))" |
|
|
|
%psc% "$f=[IO.File]::ReadAllText('!_batp!') -split ':tsforge\:.*';. ([scriptblock]::Create($f[1]))" |
|
|
|
set resetstuff= |
|
|
|
set resetstuff= |
|
|
|
if !errorlevel!==3 ( |
|
|
|
if !errorlevel!==3 ( |
|
|
|
set error=1 |
|
|
|
set error=1 |
|
|
|
@ -1545,10 +1545,10 @@ if %winbuild% GEQ 10586 ( |
|
|
|
for %%# in ("%SysPath%\spp\tokens\skus\%tsedition%\*CSVLK*.xrm-ms") do ( |
|
|
|
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 (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=[System.IO.File]::ReadAllText('!_batp!') -split ':xrm\:.*';. ([scriptblock]::Create($f[1])); InstallLicenseArr '!_arr!'" %nul% |
|
|
|
if defined _arr %psc% "$sls = Get-WmiObject %sps%; $f=[IO.File]::ReadAllText('!_batp!') -split ':xrm\:.*';. ([scriptblock]::Create($f[1])); InstallLicenseArr '!_arr!'" %nul% |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
for /f "delims=" %%a in ('%psc% "$f=[System.IO.File]::ReadAllText('!_batp!') -split ':wintsid\:.*';. ([scriptblock]::Create($f[1]))" %nul6%') do ( |
|
|
|
for /f "delims=" %%a in ('%psc% "$f=[IO.File]::ReadAllText('!_batp!') -split ':wintsid\:.*';. ([scriptblock]::Create($f[1]))" %nul6%') do ( |
|
|
|
echo "%%a" | findstr /r ".*-.*-.*-.*-.*" %nul1% && (set tsids=!tsids! %%a& set tempid=%%a) |
|
|
|
echo "%%a" | findstr /r ".*-.*-.*-.*-.*" %nul1% && (set tsids=!tsids! %%a& set tempid=%%a) |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
@ -1742,7 +1742,7 @@ echo Processing Reset of Rearm / Timers / Tamper / Lock... |
|
|
|
echo: |
|
|
|
echo: |
|
|
|
|
|
|
|
|
|
|
|
set resetstuff=1 |
|
|
|
set resetstuff=1 |
|
|
|
%psc% "$f=[System.IO.File]::ReadAllText('!_batp!') -split ':tsforge\:.*';. ([scriptblock]::Create($f[1]))" |
|
|
|
%psc% "$f=[IO.File]::ReadAllText('!_batp!') -split ':tsforge\:.*';. ([scriptblock]::Create($f[1]))" |
|
|
|
|
|
|
|
|
|
|
|
if %errorlevel%==3 ( |
|
|
|
if %errorlevel%==3 ( |
|
|
|
call :dk_color %Red% "Reset Failed." |
|
|
|
call :dk_color %Red% "Reset Failed." |
|
|
|
@ -1790,7 +1790,7 @@ if %errorlevel%==1 exit /b |
|
|
|
echo: |
|
|
|
echo: |
|
|
|
echo Fetching Supported Activation IDs list. Please wait... |
|
|
|
echo Fetching Supported Activation IDs list. Please wait... |
|
|
|
|
|
|
|
|
|
|
|
%psc% "$f=[System.IO.File]::ReadAllText('!_batp!') -split ':listactids\:.*';. ([scriptblock]::Create($f[1]))" |
|
|
|
%psc% "$f=[IO.File]::ReadAllText('!_batp!') -split ':listactids\:.*';. ([scriptblock]::Create($f[1]))" |
|
|
|
if %errorlevel%==3 ( |
|
|
|
if %errorlevel%==3 ( |
|
|
|
call :dk_color %Gray% "No supported activation ID found, aborting..." |
|
|
|
call :dk_color %Gray% "No supported activation ID found, aborting..." |
|
|
|
goto :dk_done |
|
|
|
goto :dk_done |
|
|
|
@ -1940,7 +1940,7 @@ echo Writing TrustedStore data... |
|
|
|
if /i %tsmethod%==StaticCID (echo Depositing Static Confirmation ID...) else (echo Depositing Zero Confirmation ID...) |
|
|
|
if /i %tsmethod%==StaticCID (echo Depositing Static Confirmation ID...) else (echo Depositing Zero Confirmation ID...) |
|
|
|
) |
|
|
|
) |
|
|
|
echo: |
|
|
|
echo: |
|
|
|
%psc% "$f=[System.IO.File]::ReadAllText('!_batp!') -split ':tsforge\:.*';. ([scriptblock]::Create($f[1])) %tsids%" |
|
|
|
%psc% "$f=[IO.File]::ReadAllText('!_batp!') -split ':tsforge\:.*';. ([scriptblock]::Create($f[1])) %tsids%" |
|
|
|
if !errorlevel!==3 ( |
|
|
|
if !errorlevel!==3 ( |
|
|
|
if %_actman%==0 (if not defined showfix call :dk_color %Blue% "%_fixmsg%") |
|
|
|
if %_actman%==0 (if not defined showfix call :dk_color %Blue% "%_fixmsg%") |
|
|
|
set fixes=%fixes% %mas%troubleshoot |
|
|
|
set fixes=%fixes% %mas%troubleshoot |
|
|
|
@ -2225,7 +2225,7 @@ echo !_License! | find /i "Retail" %nul% && (set keytype=zero) || (set keytype=k |
|
|
|
set keytype=zero |
|
|
|
set keytype=zero |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
for /f "delims=" %%a in ('%psc% "$f=[System.IO.File]::ReadAllText('!_batp!') -split ':offtsid\:.*';. ([scriptblock]::Create($f[1]))" %nul6%') do ( |
|
|
|
for /f "delims=" %%a in ('%psc% "$f=[IO.File]::ReadAllText('!_batp!') -split ':offtsid\:.*';. ([scriptblock]::Create($f[1]))" %nul6%') do ( |
|
|
|
echo "%%a" | findstr /r ".*-.*-.*-.*-.*" %nul1% && (set tsids=!tsids! %%a& set _actid=%%a) |
|
|
|
echo "%%a" | findstr /r ".*-.*-.*-.*-.*" %nul1% && (set tsids=!tsids! %%a& set _actid=%%a) |
|
|
|
) |
|
|
|
) |
|
|
|
set "_allactid=!tsids!" |
|
|
|
set "_allactid=!tsids!" |
|
|
|
@ -2346,7 +2346,7 @@ for %%# in ("!_oLPath!\%_License%*.xrm-ms") do ( |
|
|
|
if defined _arr (set "_arr=!_arr!;"!_oLPath!\%%~nx#"") else (set "_arr="!_oLPath!\%%~nx#"") |
|
|
|
if defined _arr (set "_arr=!_arr!;"!_oLPath!\%%~nx#"") else (set "_arr="!_oLPath!\%%~nx#"") |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
%psc% "$sls = Get-WmiObject %sps%; $f=[System.IO.File]::ReadAllText('!_batp!') -split ':xrm\:.*';. ([scriptblock]::Create($f[1])); InstallLicenseArr '!_arr!'; InstallLicenseFile '"!_oLPath!\pkeyconfig-office.xrm-ms"'" %nul% |
|
|
|
%psc% "$sls = Get-WmiObject %sps%; $f=[IO.File]::ReadAllText('!_batp!') -split ':xrm\:.*';. ([scriptblock]::Create($f[1])); InstallLicenseArr '!_arr!'; InstallLicenseFile '"!_oLPath!\pkeyconfig-office.xrm-ms"'" %nul% |
|
|
|
|
|
|
|
|
|
|
|
call :dk_actids 0ff1ce15-a989-479d-af46-f275c6370663 |
|
|
|
call :dk_actids 0ff1ce15-a989-479d-af46-f275c6370663 |
|
|
|
echo "!allapps!" | find /i "!_actid!" %nul1% || ( |
|
|
|
echo "!allapps!" | find /i "!_actid!" %nul1% || ( |
|
|
|
@ -2570,8 +2570,8 @@ exit /b |
|
|
|
:oh_licrefresh |
|
|
|
:oh_licrefresh |
|
|
|
|
|
|
|
|
|
|
|
if exist "%SysPath%\spp\store_test\2.0\tokens.dat" ( |
|
|
|
if exist "%SysPath%\spp\store_test\2.0\tokens.dat" ( |
|
|
|
%psc% "Stop-Service sppsvc -force; $sls = Get-WmiObject SoftwareLicensingService; $f=[System.IO.File]::ReadAllText('!_batp!') -split ':xrm\:.*';. ([scriptblock]::Create($f[1])); ReinstallLicenses" %nul% |
|
|
|
%psc% "Stop-Service sppsvc -force; $sls = Get-WmiObject SoftwareLicensingService; $f=[IO.File]::ReadAllText('!_batp!') -split ':xrm\:.*';. ([scriptblock]::Create($f[1])); ReinstallLicenses" %nul% |
|
|
|
if !errorlevel! NEQ 0 %psc% "$sls = Get-WmiObject SoftwareLicensingService; $f=[System.IO.File]::ReadAllText('!_batp!') -split ':xrm\:.*';. ([scriptblock]::Create($f[1])); ReinstallLicenses" %nul% |
|
|
|
if !errorlevel! NEQ 0 %psc% "$sls = Get-WmiObject SoftwareLicensingService; $f=[IO.File]::ReadAllText('!_batp!') -split ':xrm\:.*';. ([scriptblock]::Create($f[1])); ReinstallLicenses" %nul% |
|
|
|
) |
|
|
|
) |
|
|
|
exit /b |
|
|
|
exit /b |
|
|
|
|
|
|
|
|
|
|
|
@ -2726,7 +2726,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 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 %_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=[System.IO.File]::ReadAllText('!_batp!') -split ':winsubstatus\:.*';. ([scriptblock]::Create($f[1]))" %nul2% | find /i "Subscription_is_activated" %nul% && ( |
|
|
|
if %winbuild% GEQ 15063 %psc% "$f=[IO.File]::ReadAllText('!_batp!') -split ':winsubstatus\:.*';. ([scriptblock]::Create($f[1]))" %nul2% | find /i "Subscription_is_activated" %nul% && ( |
|
|
|
if defined regSKU if defined slcSKU if not "%regSKU%"=="%slcSKU%" ( |
|
|
|
if defined regSKU if defined slcSKU if not "%regSKU%"=="%slcSKU%" ( |
|
|
|
set winsub=1 |
|
|
|
set winsub=1 |
|
|
|
set osSKU=%regSKU% |
|
|
|
set osSKU=%regSKU% |
|
|
|
@ -3354,7 +3354,7 @@ set showfix=1 |
|
|
|
|
|
|
|
|
|
|
|
set chkalp= |
|
|
|
set chkalp= |
|
|
|
set wpainfo=NotFound |
|
|
|
set wpainfo=NotFound |
|
|
|
for /f "delims=" %%a in ('%psc% "$f=[System.IO.File]::ReadAllText('!_batp!') -split ':wpatest\:.*';. ([scriptblock]::Create($f[1]))" %nul6%') do (set wpainfo=%%a) |
|
|
|
for /f "delims=" %%a in ('%psc% "$f=[IO.File]::ReadAllText('!_batp!') -split ':wpatest\:.*';. ([scriptblock]::Create($f[1]))" %nul6%') do (set wpainfo=%%a) |
|
|
|
for /f "delims=0123456789" %%i in ("%wpainfo%") do set chkalp=%%i |
|
|
|
for /f "delims=0123456789" %%i in ("%wpainfo%") do set chkalp=%%i |
|
|
|
|
|
|
|
|
|
|
|
if defined chkalp ( |
|
|
|
if defined chkalp ( |
|
|
|
@ -3428,7 +3428,7 @@ set showfix=1 |
|
|
|
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f |
|
|
|
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f |
|
|
|
|
|
|
|
|
|
|
|
if not defined apps ( |
|
|
|
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=[System.IO.File]::ReadAllText('!_batp!') -split ':xrm\:.*';. ([scriptblock]::Create($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.File]::ReadAllText('!_batp!') -split ':xrm\:.*';. ([scriptblock]::Create($f[1])); ReinstallLicenses" %nul% |
|
|
|
if not defined _vis if !errorlevel! NEQ 0 set rlicfailed=1 |
|
|
|
if not defined _vis if !errorlevel! NEQ 0 set rlicfailed=1 |
|
|
|
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f |
|
|
|
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f |
|
|
|
) |
|
|
|
) |
|
|
|
|