New
#1050
What does this do different vs the previous .reg file that was available and working to do 20H2 In-place-upgrade repair?Okay, finally got it working. Had to switch to SETACL from Helge Klein instead of REGINI or SUBINACL.
Here is the working code:
Code::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: Written by Ztruker (TenForums.com/members/ztruker.html) 11/10/2020 :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: @echo off :: :: Restart as Admin if not already running as Admin :: (Net session >nul 2>&1)||(PowerShell start """%~0""" -verb RunAs & Exit /B) :: :: First backup existing key :: (REG EXPORT "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\EditionVersion" %temp%\EditionVersion.Backup.reg /y) || Goto Error :: :: Use SETACL from Helge Klein to change ownership of key to administrators and give them full control :: https://helgeklein.com/setacl/documentation/command-line-version-setacl-exe/ : (SetACL.exe -on "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\EditionVersion" -ot reg -actn setowner -ownr "n:Administrators" -rec Yes) || Goto Error (SetACL.exe -on "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\EditionVersion" -ot reg -actn ace -ace "n:Administrators;p:full" -rec Yes) || Goto Error Echo. Echo Key now owned by Administrators with Full permissions. :: :: Reg file is below. It is written to the %temp% directory as :: Allow_20H2_Repair_Install_Keep_Everything.reg :: then imported into the registry using the REG IMPORT command. :: SET ScriptDirectory=%~dp0 Set ScriptName=%~n0 Set ScriptExt=%~x0 SET "REGScript=%ScriptDirectory%%ScriptName%.REG" (Echo Windows Registry Editor Version 5.00 Echo. Echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\EditionVersion] Echo "EditionBuildBranch"="vb_release" Echo "EditionBuildLab"="19041.vb_release.19041.508" Echo "EditionBuildLabEx"="19041.1.amd64fre.vb_release.19041.508" Echo "EditionBuildNumber"=dword:00004a61 Echo "EditionBuildQfe"=dword:000001fc) > "%REGScript%" :: :: Add entries to registry. :: Echo. Echo Updating registry (REG IMPORT %REGScript%) || Goto Error Echo. Echo Registry key updated from: type %temp%\EditionVersion.Backup.reg Echo. Echo to Echo. type %REGScript% Goto Complete :: :: Come here on any error :: :Error Echo An error occurred. Save the command prompt window text to examine. Echo If needed, a backup of the registry key is in %temp%\EditionVersion.Backup.reg Echo. Echo ACL for key follows: eCHO. Powershell Get-Acl -Path 'HKLM:SOFTWARE\Microsoft\Windows NT\CurrentVersion\EditionVersion' ^| Format-List :: :: Only exit from script. Require user to press Enter. :: :Complete pause