Repair Install Windows 10 with an In-place Upgrade  


  1. Posts : 21,421
    19044.1586 - 21H2 Pro x64
       #1050

    Ztruker said:
    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
    What does this do different vs the previous .reg file that was available and working to do 20H2 In-place-upgrade repair?
      My Computer


  2. Posts : 14,046
    Windows 11 Pro X64 22H2 22621.1848
       #1051

    The previous reg file did not change the ownership or permissions of the registry key. This batch file does, then applies the reg file so it does it all.

    Here is a zip file that includes SETACL.EXE. Unzip to any folder, double click on Allow_20H2_Repair_Install_Keep_Everything.bat and it should work.

    Allow_20H2_Repair_Install_Keep_Everything.zip

    And the final batch file:

    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
    ::
    :: Figure out where we are running from, change directory to there
    ::
    SET ScriptDirectory=%~dp0
    Set ScriptName=%~n0
    Set ScriptExt=%~x0
    CD /D %ScriptDirectory%
    SET "REGScript=%ScriptDirectory%%ScriptName%.REG"
    ::
    :: 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.
    ::
    (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%
    Echo.
    Echo If needed, a backup of the registry key is in %temp%\EditionVersion.Backup.reg
    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
      My Computers


  3. Posts : 56,832
    Multi-boot Windows 10/11 - RTM, RP, Beta, and Insider
       #1052

    Ztruker said:
    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

    Confirmed. I took it this far, and bailed out.

    Repair Install Windows 10 with an In-place Upgrade-2020-11-10_18h18_39.png
      My Computers


  4. Posts : 14,046
    Windows 11 Pro X64 22H2 22621.1848
       #1053

    Thanks TC. I had already installed both CAB files so didn't try them again. Good to know it works as advertised.

    I wonder what the Windows Update version does to the registry key:

    reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\EditionVersion"

    Powershell Get-Acl -Path 'HKLM:SOFTWARE\Microsoft\Windows NT\CurrentVersion\EditionVersion' ^| Format-List
      My Computers


  5. Posts : 1,862
    Windows 10 Pro 2004 20H1
       #1054

    The issue doesn't seem to be getting any traction at Microsoft.

    I saw a post on Feedback from 2 weeks ago that so far has gotten no replies.

    I've never seen it on the MS Known Issues and Notifications list for 20H2.

    The workarounds should probably be broken out into a separate sticky thread to make it easier for folks to find.

    It may be a while before it gets fixed.
      My Computer


  6. Posts : 56,832
    Multi-boot Windows 10/11 - RTM, RP, Beta, and Insider
       #1055

    Ztruker said:
    Thanks TC. I had already installed both CAB files so didn't try them again. Good to know it works as advertised.

    I wonder what the Windows Update version does to the registry key:

    reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\EditionVersion"

    Powershell Get-Acl -Path 'HKLM:SOFTWARE\Microsoft\Windows NT\CurrentVersion\EditionVersion' ^| Format-List

    I can tell you one thing this .reg does that was totally unexpected. After I had run (ran?) your .bat, I tested the ISO and bailed out, I neglected to put the .reg entries back the way they were. Next time I restarted, I was greeted with the Startup Tab in Task Manager updating again! I left it and got an update this morning, also. No idea whatsoever what the relationship is, only that your .bat and it's .reg tickled the process to work again. Almost like the OS is programmatically looking at these 2 sub-keys, and somehow deciding to run the Impact calcs or not. I do not know.

    I verified all this on a second 20H2 19042 and got same results. Just those 2 sub-keys was enough to trigger the results.

    Repair Install Windows 10 with an In-place Upgrade-2020-11-11_11h28_37.png

    Repair Install Windows 10 with an In-place Upgrade-2020-11-11_05h39_32.pngRepair Install Windows 10 with an In-place Upgrade-2020-11-11_05h42_27.png
      My Computers


  7. Posts : 14,046
    Windows 11 Pro X64 22H2 22621.1848
       #1056

    SO those two keys fixed the problem? That is really strange.

    I don't have the problem so can't test it. I have been running with the keys set aat the batch leaves them for a couple days now with no observable affects.
      My Computers


  8. Posts : 51
    Windows 10 Pro 64
       #1057

    HI Brink,
    I am trying to do an in-place upgrade of my Windows 10 20H2 (compilation 19042.630), I always give up as it says that cannot keep my files and programs because my Windows must be in another folder not supported or it is a newer version.
    I have downloaded version 20H2 from media creation tool.
    Do you have a solution for this?
    Many thanks
      My Computer


  9. Posts : 43,022
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #1058

    - that's what's discussed in a long string of posts above where people have been working on just that... that's the latest...

    Please confirm that you didn't also have this problem with earlier major builds.
      My Computers


  10. Posts : 21,421
    19044.1586 - 21H2 Pro x64
       #1059

    f14tomcat said:
    I can tell you one thing this .reg does that was totally unexpected. After I had run (ran?) your .bat, I tested the ISO and bailed out, I neglected to put the .reg entries back the way they were. Next time I restarted, I was greeted with the Startup Tab in Task Manager updating again! I left it and got an update this morning, also. No idea whatsoever what the relationship is, only that your .bat and it's .reg tickled the process to work again. Almost like the OS is programmatically looking at these 2 sub-keys, and somehow deciding to run the Impact calcs or not. I do not know.

    I verified all this on a second 20H2 19042 and got same results. Just those 2 sub-keys was enough to trigger the results.

    Repair Install Windows 10 with an In-place Upgrade-2020-11-11_11h28_37.png

    Repair Install Windows 10 with an In-place Upgrade-2020-11-11_05h39_32.pngRepair Install Windows 10 with an In-place Upgrade-2020-11-11_05h42_27.png
    Do Startup calculations persist after a restart or cold start?
      My Computer


 

Tutorial Categories

Repair Install Windows 10 with an In-place Upgrade Tutorial Index Network & Sharing Instalation and Upgrade Browsers and Email General Tips Gaming Customization Apps and Features Virtualization BSOD System Security User Accounts Hardware and Drivers Updates and Activation Backup and Restore Performance and Maintenance Mixed Reality Phone


  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 14:22.
Find Us




Windows 10 Forums