Fix Microsoft links

This commit is contained in:
WindowsAddict 2025-05-08 05:31:04 +05:30
parent 2d00dfa704
commit 4c53e6231b
8 changed files with 40 additions and 40 deletions

View File

@ -1607,7 +1607,7 @@ call :dk_color2 %Red% "Checking Boot Mode [%safeboot_option
) )
:: https://learn.microsoft.com/windows-hardware/manufacture/desktop/windows-setup-states :: https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/windows-setup-states
for /f "skip=2 tokens=2*" %%A in ('reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State" /v ImageState') do (set imagestate=%%B) for /f "skip=2 tokens=2*" %%A in ('reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State" /v ImageState') do (set imagestate=%%B)
@ -1878,7 +1878,7 @@ set "permerror=Error Found In SPP Registries"
) )
) )
REM https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application REM https://learn.microsoft.com/en-us/office/troubleshoot/activation/license-issue-when-start-office-application
if not defined permerror ( if not defined permerror (
reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && ( reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && (
@ -3156,7 +3156,7 @@ exit /b
:oh_clearblock :oh_clearblock
:: Find remnants of Office vNext/shared/device license block and remove it because it stops other licenses from appearing :: Find remnants of Office vNext/shared/device license block and remove it because it stops other licenses from appearing
:: https://learn.microsoft.com/office/troubleshoot/activation/reset-office-365-proplus-activation-state :: https://learn.microsoft.com/en-us/office/troubleshoot/activation/reset-office-365-proplus-activation-state
set _sidlist= set _sidlist=
for /f "tokens=* delims=" %%a in ('%psc% "$p = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList'; Get-ChildItem $p | ForEach-Object { $pi = (Get-ItemProperty """"$p\$($_.PSChildName)"""").ProfileImagePath; if ($pi -like '*\Users\*' -and (Test-Path """"$pi\NTUSER.DAT"""") -and -not ($_.PSChildName -match '\.bak$')) { Split-Path $_.PSPath -Leaf } }" %nul6%') do (if defined _sidlist (set _sidlist=!_sidlist! %%a) else (set _sidlist=%%a)) for /f "tokens=* delims=" %%a in ('%psc% "$p = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList'; Get-ChildItem $p | ForEach-Object { $pi = (Get-ItemProperty """"$p\$($_.PSChildName)"""").ProfileImagePath; if ($pi -like '*\Users\*' -and (Test-Path """"$pi\NTUSER.DAT"""") -and -not ($_.PSChildName -match '\.bak$')) { Split-Path $_.PSPath -Leaf } }" %nul6%') do (if defined _sidlist (set _sidlist=!_sidlist! %%a) else (set _sidlist=%%a))
@ -3252,12 +3252,12 @@ reg delete HKLM\SOFTWARE\Microsoft\Office\15.0\ClickToRun\Configuration /v Share
) )
:: Clear device-based-licensing :: Clear device-based-licensing
:: https://learn.microsoft.com/deployoffice/device-based-licensing :: https://learn.microsoft.com/en-us/deployoffice/device-based-licensing
for /f %%# in ('reg query "%o16c2r_reg%\Configuration" /f *.DeviceBasedLicensing %nul6% ^| findstr REG_') do reg delete "%o16c2r_reg%\Configuration" /v %%# /f %nul% for /f %%# in ('reg query "%o16c2r_reg%\Configuration" /f *.DeviceBasedLicensing %nul6% ^| findstr REG_') do reg delete "%o16c2r_reg%\Configuration" /v %%# /f %nul%
:: Remove OEM registry key :: Remove OEM registry key
:: https://support.microsoft.com/office/office-repeatedly-prompts-you-to-activate-on-a-new-pc-a9a6b05f-f6ce-4d1f-8d49-eb5007b64ba1 :: https://support.microsoft.com/en-us/office/office-repeatedly-prompts-you-to-activate-on-a-new-pc-a9a6b05f-f6ce-4d1f-8d49-eb5007b64ba1
for %%# in (15 16) do ( for %%# in (15 16) do (
reg delete "HKLM\SOFTWARE\Microsoft\Office\%%#.0\Common\OEM" /f %nul% reg delete "HKLM\SOFTWARE\Microsoft\Office\%%#.0\Common\OEM" /f %nul%
@ -4002,8 +4002,8 @@ reg query "HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5" /v Install %nul
echo .NET 3.5 Framework is not installed in your system. echo .NET 3.5 Framework is not installed in your system.
echo Install it using the following URL. echo Install it using the following URL.
echo: echo:
echo https://www.microsoft.com/download/details.aspx?id=25150 echo https://www.microsoft.com/en-us/download/details.aspx?id=25150
if %_unattended%==0 start https://www.microsoft.com/download/details.aspx?id=25150 if %_unattended%==0 start https://www.microsoft.com/en-us/download/details.aspx?id=25150
goto dk_done goto dk_done
) )
) )
@ -12219,7 +12219,7 @@ call :oh_licrefresh
:ks_activate :ks_activate
:: Opt out of sending KMSclient activation data to Microsoft :: Opt out of sending KMSclient activation data to Microsoft
:: https://learn.microsoft.com/windows/privacy/manage-connections-from-windows-operating-system-components-to-microsoft-services#19-software-protection-platform :: https://learn.microsoft.com/en-us/windows/privacy/manage-connections-from-windows-operating-system-components-to-microsoft-services#19-software-protection-platform
if %winbuild% GEQ 9600 ( if %winbuild% GEQ 9600 (
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform" /v NoGenTicket /t REG_DWORD /d 1 /f %nul% reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform" /v NoGenTicket /t REG_DWORD /d 1 /f %nul%
@ -12287,7 +12287,7 @@ echo Cleared %KS% Server from the registry.
) )
) )
:: https://learn.microsoft.com/azure/virtual-desktop/windows-10-multisession-faq :: https://learn.microsoft.com/en-us/azure/virtual-desktop/windows-10-multisession-faq
if %_actwin%==1 for %%# in (407) do if %osSKU%==%%# ( if %_actwin%==1 for %%# in (407) do if %osSKU%==%%# (
call :dk_color %Red% "%winos% does not support activation on non-azure platforms." call :dk_color %Red% "%winos% does not support activation on non-azure platforms."
@ -15870,7 +15870,7 @@ for %%# in (SppE%w%xtComObj.exe %_slexe%) do (reg delete "HKLM\SOFTWARE\Microsof
if %winbuild% LSS 9200 if not defined _vis ( if %winbuild% LSS 9200 if not defined _vis (
REM Fix issues caused by Update KB971033 in Windows 7 REM Fix issues caused by Update KB971033 in Windows 7
REM https://support.microsoft.com/help/4487266 REM https://support.microsoft.com/en-us/help/4487266
echo: echo:
echo Checking Update KB971033... echo Checking Update KB971033...
%psc% "if (Get-Hotfix -Id KB971033 -ErrorAction SilentlyContinue) {Exit 3}" %nul% %psc% "if (Get-Hotfix -Id KB971033 -ErrorAction SilentlyContinue) {Exit 3}" %nul%
@ -16367,7 +16367,7 @@ set "permerror=Error Found In SPP Registries"
) )
) )
REM https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application REM https://learn.microsoft.com/en-us/office/troubleshoot/activation/license-issue-when-start-office-application
if not defined permerror ( if not defined permerror (
reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && ( reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && (
@ -16413,7 +16413,7 @@ if ($env:permerror -eq 'Error Found In SPP Registries') {
} }
# Fix perms for SPP in HKU\S-1-5-20 # Fix perms for SPP in HKU\S-1-5-20
# https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application # https://learn.microsoft.com/en-us/office/troubleshoot/activation/license-issue-when-start-office-application
if ($env:permerror -ne 'Error Found In S-1-5-20 SPP') { if ($env:permerror -ne 'Error Found In S-1-5-20 SPP') {
exit exit
@ -18175,7 +18175,7 @@ call :dk_color %_Green% "Enter an option number using your keyboard and press En
set /p inpt= set /p inpt=
if "%inpt%"=="" goto :oe_changeupdchnl if "%inpt%"=="" goto :oe_changeupdchnl
if "%inpt%"=="0" goto :oemenu if "%inpt%"=="0" goto :oemenu
if /i "%inpt%"=="R" start https://learn.microsoft.com/microsoft-365-apps/updates/overview-update-channels & goto :oe_changeupdchnl if /i "%inpt%"=="R" start https://learn.microsoft.com/en-us/microsoft-365-apps/updates/overview-update-channels & goto :oe_changeupdchnl
for /l %%i in (1,1,%counter%) do (if "%inpt%"=="%%i" set verified=1) for /l %%i in (1,1,%counter%) do (if "%inpt%"=="%%i" set verified=1)
set targetFFN=!targetFFN%inpt%! set targetFFN=!targetFFN%inpt%!
set targetchannel=!targetchannel%inpt%! set targetchannel=!targetchannel%inpt%!

View File

@ -1310,7 +1310,7 @@ call :dk_color2 %Red% "Checking Boot Mode [%safeboot_option
) )
:: https://learn.microsoft.com/windows-hardware/manufacture/desktop/windows-setup-states :: https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/windows-setup-states
for /f "skip=2 tokens=2*" %%A in ('reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State" /v ImageState') do (set imagestate=%%B) for /f "skip=2 tokens=2*" %%A in ('reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State" /v ImageState') do (set imagestate=%%B)
@ -1581,7 +1581,7 @@ set "permerror=Error Found In SPP Registries"
) )
) )
REM https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application REM https://learn.microsoft.com/en-us/office/troubleshoot/activation/license-issue-when-start-office-application
if not defined permerror ( if not defined permerror (
reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && ( reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && (

View File

@ -1453,7 +1453,7 @@ call :dk_color2 %Red% "Checking Boot Mode [%safeboot_option
) )
:: https://learn.microsoft.com/windows-hardware/manufacture/desktop/windows-setup-states :: https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/windows-setup-states
for /f "skip=2 tokens=2*" %%A in ('reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State" /v ImageState') do (set imagestate=%%B) for /f "skip=2 tokens=2*" %%A in ('reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State" /v ImageState') do (set imagestate=%%B)
@ -1724,7 +1724,7 @@ set "permerror=Error Found In SPP Registries"
) )
) )
REM https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application REM https://learn.microsoft.com/en-us/office/troubleshoot/activation/license-issue-when-start-office-application
if not defined permerror ( if not defined permerror (
reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && ( reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && (

View File

@ -1356,7 +1356,7 @@ exit /b
:oh_clearblock :oh_clearblock
:: Find remnants of Office vNext/shared/device license block and remove it because it stops other licenses from appearing :: Find remnants of Office vNext/shared/device license block and remove it because it stops other licenses from appearing
:: https://learn.microsoft.com/office/troubleshoot/activation/reset-office-365-proplus-activation-state :: https://learn.microsoft.com/en-us/office/troubleshoot/activation/reset-office-365-proplus-activation-state
set _sidlist= set _sidlist=
for /f "tokens=* delims=" %%a in ('%psc% "$p = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList'; Get-ChildItem $p | ForEach-Object { $pi = (Get-ItemProperty """"$p\$($_.PSChildName)"""").ProfileImagePath; if ($pi -like '*\Users\*' -and (Test-Path """"$pi\NTUSER.DAT"""") -and -not ($_.PSChildName -match '\.bak$')) { Split-Path $_.PSPath -Leaf } }" %nul6%') do (if defined _sidlist (set _sidlist=!_sidlist! %%a) else (set _sidlist=%%a)) for /f "tokens=* delims=" %%a in ('%psc% "$p = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList'; Get-ChildItem $p | ForEach-Object { $pi = (Get-ItemProperty """"$p\$($_.PSChildName)"""").ProfileImagePath; if ($pi -like '*\Users\*' -and (Test-Path """"$pi\NTUSER.DAT"""") -and -not ($_.PSChildName -match '\.bak$')) { Split-Path $_.PSPath -Leaf } }" %nul6%') do (if defined _sidlist (set _sidlist=!_sidlist! %%a) else (set _sidlist=%%a))
@ -1452,12 +1452,12 @@ reg delete HKLM\SOFTWARE\Microsoft\Office\15.0\ClickToRun\Configuration /v Share
) )
:: Clear device-based-licensing :: Clear device-based-licensing
:: https://learn.microsoft.com/deployoffice/device-based-licensing :: https://learn.microsoft.com/en-us/deployoffice/device-based-licensing
for /f %%# in ('reg query "%o16c2r_reg%\Configuration" /f *.DeviceBasedLicensing %nul6% ^| findstr REG_') do reg delete "%o16c2r_reg%\Configuration" /v %%# /f %nul% for /f %%# in ('reg query "%o16c2r_reg%\Configuration" /f *.DeviceBasedLicensing %nul6% ^| findstr REG_') do reg delete "%o16c2r_reg%\Configuration" /v %%# /f %nul%
:: Remove OEM registry key :: Remove OEM registry key
:: https://support.microsoft.com/office/office-repeatedly-prompts-you-to-activate-on-a-new-pc-a9a6b05f-f6ce-4d1f-8d49-eb5007b64ba1 :: https://support.microsoft.com/en-us/office/office-repeatedly-prompts-you-to-activate-on-a-new-pc-a9a6b05f-f6ce-4d1f-8d49-eb5007b64ba1
for %%# in (15 16) do ( for %%# in (15 16) do (
reg delete "HKLM\SOFTWARE\Microsoft\Office\%%#.0\Common\OEM" /f %nul% reg delete "HKLM\SOFTWARE\Microsoft\Office\%%#.0\Common\OEM" /f %nul%
@ -1971,7 +1971,7 @@ call :dk_color2 %Red% "Checking Boot Mode [%safeboot_option
) )
:: https://learn.microsoft.com/windows-hardware/manufacture/desktop/windows-setup-states :: https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/windows-setup-states
for /f "skip=2 tokens=2*" %%A in ('reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State" /v ImageState') do (set imagestate=%%B) for /f "skip=2 tokens=2*" %%A in ('reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State" /v ImageState') do (set imagestate=%%B)
@ -2242,7 +2242,7 @@ set "permerror=Error Found In SPP Registries"
) )
) )
REM https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application REM https://learn.microsoft.com/en-us/office/troubleshoot/activation/license-issue-when-start-office-application
if not defined permerror ( if not defined permerror (
reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && ( reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && (

View File

@ -931,7 +931,7 @@ call :oh_licrefresh
:ks_activate :ks_activate
:: Opt out of sending KMSclient activation data to Microsoft :: Opt out of sending KMSclient activation data to Microsoft
:: https://learn.microsoft.com/windows/privacy/manage-connections-from-windows-operating-system-components-to-microsoft-services#19-software-protection-platform :: https://learn.microsoft.com/en-us/windows/privacy/manage-connections-from-windows-operating-system-components-to-microsoft-services#19-software-protection-platform
if %winbuild% GEQ 9600 ( if %winbuild% GEQ 9600 (
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform" /v NoGenTicket /t REG_DWORD /d 1 /f %nul% reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform" /v NoGenTicket /t REG_DWORD /d 1 /f %nul%
@ -999,7 +999,7 @@ echo Cleared %KS% Server from the registry.
) )
) )
:: https://learn.microsoft.com/azure/virtual-desktop/windows-10-multisession-faq :: https://learn.microsoft.com/en-us/azure/virtual-desktop/windows-10-multisession-faq
if %_actwin%==1 for %%# in (407) do if %osSKU%==%%# ( if %_actwin%==1 for %%# in (407) do if %osSKU%==%%# (
call :dk_color %Red% "%winos% does not support activation on non-azure platforms." call :dk_color %Red% "%winos% does not support activation on non-azure platforms."
@ -1330,7 +1330,7 @@ exit /b
:oh_clearblock :oh_clearblock
:: Find remnants of Office vNext/shared/device license block and remove it because it stops other licenses from appearing :: Find remnants of Office vNext/shared/device license block and remove it because it stops other licenses from appearing
:: https://learn.microsoft.com/office/troubleshoot/activation/reset-office-365-proplus-activation-state :: https://learn.microsoft.com/en-us/office/troubleshoot/activation/reset-office-365-proplus-activation-state
set _sidlist= set _sidlist=
for /f "tokens=* delims=" %%a in ('%psc% "$p = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList'; Get-ChildItem $p | ForEach-Object { $pi = (Get-ItemProperty """"$p\$($_.PSChildName)"""").ProfileImagePath; if ($pi -like '*\Users\*' -and (Test-Path """"$pi\NTUSER.DAT"""") -and -not ($_.PSChildName -match '\.bak$')) { Split-Path $_.PSPath -Leaf } }" %nul6%') do (if defined _sidlist (set _sidlist=!_sidlist! %%a) else (set _sidlist=%%a)) for /f "tokens=* delims=" %%a in ('%psc% "$p = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList'; Get-ChildItem $p | ForEach-Object { $pi = (Get-ItemProperty """"$p\$($_.PSChildName)"""").ProfileImagePath; if ($pi -like '*\Users\*' -and (Test-Path """"$pi\NTUSER.DAT"""") -and -not ($_.PSChildName -match '\.bak$')) { Split-Path $_.PSPath -Leaf } }" %nul6%') do (if defined _sidlist (set _sidlist=!_sidlist! %%a) else (set _sidlist=%%a))
@ -1426,12 +1426,12 @@ reg delete HKLM\SOFTWARE\Microsoft\Office\15.0\ClickToRun\Configuration /v Share
) )
:: Clear device-based-licensing :: Clear device-based-licensing
:: https://learn.microsoft.com/deployoffice/device-based-licensing :: https://learn.microsoft.com/en-us/deployoffice/device-based-licensing
for /f %%# in ('reg query "%o16c2r_reg%\Configuration" /f *.DeviceBasedLicensing %nul6% ^| findstr REG_') do reg delete "%o16c2r_reg%\Configuration" /v %%# /f %nul% for /f %%# in ('reg query "%o16c2r_reg%\Configuration" /f *.DeviceBasedLicensing %nul6% ^| findstr REG_') do reg delete "%o16c2r_reg%\Configuration" /v %%# /f %nul%
:: Remove OEM registry key :: Remove OEM registry key
:: https://support.microsoft.com/office/office-repeatedly-prompts-you-to-activate-on-a-new-pc-a9a6b05f-f6ce-4d1f-8d49-eb5007b64ba1 :: https://support.microsoft.com/en-us/office/office-repeatedly-prompts-you-to-activate-on-a-new-pc-a9a6b05f-f6ce-4d1f-8d49-eb5007b64ba1
for %%# in (15 16) do ( for %%# in (15 16) do (
reg delete "HKLM\SOFTWARE\Microsoft\Office\%%#.0\Common\OEM" /f %nul% reg delete "HKLM\SOFTWARE\Microsoft\Office\%%#.0\Common\OEM" /f %nul%
@ -3023,7 +3023,7 @@ call :dk_color2 %Red% "Checking Boot Mode [%safeboot_option
) )
:: https://learn.microsoft.com/windows-hardware/manufacture/desktop/windows-setup-states :: https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/windows-setup-states
for /f "skip=2 tokens=2*" %%A in ('reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State" /v ImageState') do (set imagestate=%%B) for /f "skip=2 tokens=2*" %%A in ('reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State" /v ImageState') do (set imagestate=%%B)
@ -3294,7 +3294,7 @@ set "permerror=Error Found In SPP Registries"
) )
) )
REM https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application REM https://learn.microsoft.com/en-us/office/troubleshoot/activation/license-issue-when-start-office-application
if not defined permerror ( if not defined permerror (
reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && ( reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && (

View File

@ -238,8 +238,8 @@ reg query "HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5" /v Install %nul
echo .NET 3.5 Framework is not installed in your system. echo .NET 3.5 Framework is not installed in your system.
echo Install it using the following URL. echo Install it using the following URL.
echo: echo:
echo https://www.microsoft.com/download/details.aspx?id=25150 echo https://www.microsoft.com/en-us/download/details.aspx?id=25150
if %_unattended%==0 start https://www.microsoft.com/download/details.aspx?id=25150 if %_unattended%==0 start https://www.microsoft.com/en-us/download/details.aspx?id=25150
goto dk_done goto dk_done
) )
) )
@ -1944,7 +1944,7 @@ exit /b
:oh_clearblock :oh_clearblock
:: Find remnants of Office vNext/shared/device license block and remove it because it stops other licenses from appearing :: Find remnants of Office vNext/shared/device license block and remove it because it stops other licenses from appearing
:: https://learn.microsoft.com/office/troubleshoot/activation/reset-office-365-proplus-activation-state :: https://learn.microsoft.com/en-us/office/troubleshoot/activation/reset-office-365-proplus-activation-state
set _sidlist= set _sidlist=
for /f "tokens=* delims=" %%a in ('%psc% "$p = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList'; Get-ChildItem $p | ForEach-Object { $pi = (Get-ItemProperty """"$p\$($_.PSChildName)"""").ProfileImagePath; if ($pi -like '*\Users\*' -and (Test-Path """"$pi\NTUSER.DAT"""") -and -not ($_.PSChildName -match '\.bak$')) { Split-Path $_.PSPath -Leaf } }" %nul6%') do (if defined _sidlist (set _sidlist=!_sidlist! %%a) else (set _sidlist=%%a)) for /f "tokens=* delims=" %%a in ('%psc% "$p = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList'; Get-ChildItem $p | ForEach-Object { $pi = (Get-ItemProperty """"$p\$($_.PSChildName)"""").ProfileImagePath; if ($pi -like '*\Users\*' -and (Test-Path """"$pi\NTUSER.DAT"""") -and -not ($_.PSChildName -match '\.bak$')) { Split-Path $_.PSPath -Leaf } }" %nul6%') do (if defined _sidlist (set _sidlist=!_sidlist! %%a) else (set _sidlist=%%a))
@ -2040,12 +2040,12 @@ reg delete HKLM\SOFTWARE\Microsoft\Office\15.0\ClickToRun\Configuration /v Share
) )
:: Clear device-based-licensing :: Clear device-based-licensing
:: https://learn.microsoft.com/deployoffice/device-based-licensing :: https://learn.microsoft.com/en-us/deployoffice/device-based-licensing
for /f %%# in ('reg query "%o16c2r_reg%\Configuration" /f *.DeviceBasedLicensing %nul6% ^| findstr REG_') do reg delete "%o16c2r_reg%\Configuration" /v %%# /f %nul% for /f %%# in ('reg query "%o16c2r_reg%\Configuration" /f *.DeviceBasedLicensing %nul6% ^| findstr REG_') do reg delete "%o16c2r_reg%\Configuration" /v %%# /f %nul%
:: Remove OEM registry key :: Remove OEM registry key
:: https://support.microsoft.com/office/office-repeatedly-prompts-you-to-activate-on-a-new-pc-a9a6b05f-f6ce-4d1f-8d49-eb5007b64ba1 :: https://support.microsoft.com/en-us/office/office-repeatedly-prompts-you-to-activate-on-a-new-pc-a9a6b05f-f6ce-4d1f-8d49-eb5007b64ba1
for %%# in (15 16) do ( for %%# in (15 16) do (
reg delete "HKLM\SOFTWARE\Microsoft\Office\%%#.0\Common\OEM" /f %nul% reg delete "HKLM\SOFTWARE\Microsoft\Office\%%#.0\Common\OEM" /f %nul%
@ -2638,7 +2638,7 @@ call :dk_color2 %Red% "Checking Boot Mode [%safeboot_option
) )
:: https://learn.microsoft.com/windows-hardware/manufacture/desktop/windows-setup-states :: https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/windows-setup-states
for /f "skip=2 tokens=2*" %%A in ('reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State" /v ImageState') do (set imagestate=%%B) for /f "skip=2 tokens=2*" %%A in ('reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State" /v ImageState') do (set imagestate=%%B)
@ -2909,7 +2909,7 @@ set "permerror=Error Found In SPP Registries"
) )
) )
REM https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application REM https://learn.microsoft.com/en-us/office/troubleshoot/activation/license-issue-when-start-office-application
if not defined permerror ( if not defined permerror (
reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && ( reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && (

View File

@ -1044,7 +1044,7 @@ call :dk_color %_Green% "Enter an option number using your keyboard and press En
set /p inpt= set /p inpt=
if "%inpt%"=="" goto :oe_changeupdchnl if "%inpt%"=="" goto :oe_changeupdchnl
if "%inpt%"=="0" goto :oemenu if "%inpt%"=="0" goto :oemenu
if /i "%inpt%"=="R" start https://learn.microsoft.com/microsoft-365-apps/updates/overview-update-channels & goto :oe_changeupdchnl if /i "%inpt%"=="R" start https://learn.microsoft.com/en-us/microsoft-365-apps/updates/overview-update-channels & goto :oe_changeupdchnl
for /l %%i in (1,1,%counter%) do (if "%inpt%"=="%%i" set verified=1) for /l %%i in (1,1,%counter%) do (if "%inpt%"=="%%i" set verified=1)
set targetFFN=!targetFFN%inpt%! set targetFFN=!targetFFN%inpt%!
set targetchannel=!targetchannel%inpt%! set targetchannel=!targetchannel%inpt%!

View File

@ -733,7 +733,7 @@ for %%# in (SppE%w%xtComObj.exe %_slexe%) do (reg delete "HKLM\SOFTWARE\Microsof
if %winbuild% LSS 9200 if not defined _vis ( if %winbuild% LSS 9200 if not defined _vis (
REM Fix issues caused by Update KB971033 in Windows 7 REM Fix issues caused by Update KB971033 in Windows 7
REM https://support.microsoft.com/help/4487266 REM https://support.microsoft.com/en-us/help/4487266
echo: echo:
echo Checking Update KB971033... echo Checking Update KB971033...
%psc% "if (Get-Hotfix -Id KB971033 -ErrorAction SilentlyContinue) {Exit 3}" %nul% %psc% "if (Get-Hotfix -Id KB971033 -ErrorAction SilentlyContinue) {Exit 3}" %nul%
@ -1230,7 +1230,7 @@ set "permerror=Error Found In SPP Registries"
) )
) )
REM https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application REM https://learn.microsoft.com/en-us/office/troubleshoot/activation/license-issue-when-start-office-application
if not defined permerror ( if not defined permerror (
reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && ( reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && (
@ -1276,7 +1276,7 @@ if ($env:permerror -eq 'Error Found In SPP Registries') {
} }
# Fix perms for SPP in HKU\S-1-5-20 # Fix perms for SPP in HKU\S-1-5-20
# https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application # https://learn.microsoft.com/en-us/office/troubleshoot/activation/license-issue-when-start-office-application
if ($env:permerror -ne 'Error Found In S-1-5-20 SPP') { if ($env:permerror -ne 'Error Found In S-1-5-20 SPP') {
exit exit