MSMG, In my work, I have also repeatedly encountered a problem when installing the OS - BSOD "CONFIG INITIALIZATION FAILED" after integrating Service settings into the Toolkit using registry files containing CurrentControlSet. It's true. At the time, I did not immediately understand this, having spent a lot of time on additional testing, installation, looking for the reason in the components I removed. (You know that I am additionally experimenting with the Dism list). But during testing, I realized that it wasn't about the components, and I tried to replace all the CurrentControlSet with ControlSet001 in all the Service settings. It helped immediately. The last time I encountered this was quite recently, working in Tollkit one of the penultimate versions with build 22000.160. (You haven't added ToolkitHelper support yet. I worked with the Dism list, and did not delete the Windows Defender component packages, but decided to disable it in a cardinal way, first disabling its services using registry tweaks, and then adding commands to remove these and some other unwanted Services in SetupComplete.cmd. At the same time, I already knew about the possible consequences, I just forgot to replace CurrentControlSet with ControlSet001 in tweaks. As a result, the BSOD "CONFIG INITIALIZATION FAILED" was also received at the installation stage, after a reboot. Immediately guessing the reason and replacing all CurrentControlSet with ControlSet001, I got a workable image. I will combine all the Service settings integrated by me into one file so that it is more convenient for you to view: Spoiler: CODE Code: Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\WMI\Autologger\AutoLogger-Diagtrack-Listener] "Start"=dword:00000004 [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\WMI\Autologger\Circular Kernel Context Logger] "Start"=dword:00000004 [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Diagnostics\Performance] "DisableDiagnosticTracing"=dword:00000001 [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\diagnosticshub.standardcollector.service] "Start"=dword:00000004 [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\diagsvc] "Start"=dword:00000004 [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\DiagTrack] "Start"=dword:00000004 [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\fhsvc] "Start"=dword:00000004 [-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\fhsvc\Parameters] [-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\fhsvc\Security] [-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\fhsvc\TriggerInfo] [-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\fhsvc\TriggerInfo\0] [-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\fhsvc\TriggerInfo\1] [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Sense] "Start"=dword:00000004 [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\TroubleshootingSvc] "Start"=dword:00000004 [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\WaaSMedicSvc] "Start"=dword:00000004 [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\WacomPen] "Start"=dword:00000004 [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\WbioSrvc] "Start"=dword:00000004 [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\WdFilter] "Start"=dword:00000004 [-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\WdFilter\Instances] [-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\WdFilter\Instances\WdFilter Instance] [-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\WdFilter\Security] [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\WdiServiceHost] "Start"=dword:00000004 [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\WdiSystemHost] "Start"=dword:00000004 [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\WdNisDrv] "Start"=dword:00000004 [-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\WdNisDrv\Security] [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\WdNisSvc] "Start"=dword:00000004 [-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\WdNisSvc\Parameters] [-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\WdNisSvc\Security] [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Wecsvc] "Start"=dword:00000004 [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\WinDefend] "Start"=dword:00000004 [-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\WinDefend\Security] [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\wscsvc] "Start"=dword:00000004 [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\WSearch] "Start"=dword:00000004 [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\SecurityHealthService] "Start"=dword:00000004 Although I know that Toolkit uses all the necessary tools to get elevated rights, I still run Start.cmd in my work with the help of current versions of NSudo.
if %HostBuild% lss 1903 ( for /f "tokens=3 delims= " %%k in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "ReleaseId" ^| find "REG_SZ"') do (set HostDisplayVersion=%%k) ) if %HostBuild% geq 1903 ( for /f "tokens=3 delims= " %%k in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "DisplayVersion" ^| find "REG_SZ"') do (set HostDisplayVersion=%%k) ) What would be the correct Hostbuild for this condition? 1903 = 18362? Or would it be 19043? It was missing the quotation marks. At that moment, is it like that? %ToolKitHelper% %DefaultIndexNo% "ManualSetup" Or should it be like this: %ToolKitHelper% "%InstallMount%\%DefaultIndexNo%" "ManualSetup" This works like this: if exist "%DVD%\sources\appraiserres.dll" move "%DVD%\sources\appraiserres.dll" "%DVD%\sources\appraiserres.dll.bak" and, like this: if exist "%DVD%\sources\appraiserres.dll" ren "%DVD%\sources\appraiserres.dll" "appraiserres.dll.bak" But... Using REN command and putting the full path to the original file name and full path for the new name does not work. if exist "%DVD%\sources\appraiserres.dll" ren "%DVD%\sources\appraiserres.dll" "%DVD%\sources\appraiserres.dll.bak" EDITED
Yes, is for offline image. I test in my computer and it works. I will attach the reg file, so you can see if I'm doing something wrong
For all deprovisioned apps that you used *. I believe it will not work. You have to put the full name of each app. I think you want to remove them. Then there was a signal "-". from [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\Deprovisioned] to [-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\Deprovisioned] So it will remove everything, no need to put the other lines for each app. It does not make sense to keep keys without values, in the reg file, only makes sense if it is to delete the keys. And in case you want to delete just add the signal "-" as the example above. EDIT: Except only in this case, for Apps lock, inserting them in the "Deprovisioned" key.
@DennyAmaro , Sorry... I was doing an inplace upgrade here and I was thinking about it. I just finished, I came here to report. So... For deprovisioned, it makes sense to use the keys without values. I traveled in my thoughts here. That means I did not make sense, hehehe. But still, you will have to put each app with there respective versions (full names).
@MSMG, Added HideWidgetsIcon Code: if "%SelectedSourceOS%" equ "w11" ( echo. [A] Disable Windows 11 Installer Hardware Check echo. [B] Disable Cortana App echo. [C] Hide Taskbar Chat Icon echo. [D] Hide Taskbar Task View Icon echo. [E] Hide Taskbar Meet Now Icon echo. [F] Hide Taskbar Widget Icon echo. [G] Hide Taskbar News and Interests echo. [H] Disable Automatic Driver Updates through Windows Update echo. [I] Disable Automatic Downloading and Installing 3rd Party Apps echo. [J] Disable Windows Defender echo. [K] Disable Windows Firewall echo. [L] Disable Windows SmartScreen echo. [M] Disable Automatic Windows Upgrade echo. [N] Disable Windows Update echo. [O] Disable Microsoft Reserved Storage Space for Windows Updates echo. [P] Force .NET Programs to Use Newest .NET Framework echo. [Q] Enable Windows Photo Viewer echo. [R] Enable Fraunhofer MP3 Professional Codec echo. [S] Enable DISM Image Cleanup with Full ResetBase echo. echo. [1] All Tweaks echo. [X] Go Back echo.=============================================================================== choice /C:ABCDEFGHIJKLMNOPQRS1X /N /M "Enter Your Choice : " if errorlevel 21 goto :CustomizeMenu if errorlevel 20 set "Tweak=AllTweaks" if errorlevel 19 set "Tweak=EnableFullResetBase" if errorlevel 18 set "Tweak=EnableFMP3ProCodec" if errorlevel 17 set "Tweak=EnablePhotoViewer" if errorlevel 16 set "Tweak=ForceLatestNetFramework" if errorlevel 15 set "Tweak=DisableReservedStorage" if errorlevel 14 set "Tweak=DisableWindowsUpdate" if errorlevel 13 set "Tweak=DisableWindowsUpgrade" if errorlevel 12 set "Tweak=DisableWindowsSmartScreen" if errorlevel 11 set "Tweak=DisableWindowsFirewall" if errorlevel 10 set "Tweak=DisableWindowsDefender" if errorlevel 9 set "Tweak=Disable3RDPartyApps" if errorlevel 8 set "Tweak=DisableDriversUpdates" if errorlevel 7 set "Tweak=HideNewsAndInterests" if errorlevel 6 set "Tweak=HideWidgetIcon" if errorlevel 5 set "Tweak=HideMeetNowIcon" if errorlevel 4 set "Tweak=HideTaskViewIcon" if errorlevel 3 set "Tweak=HideChatIcon" if errorlevel 2 set "Tweak=DisableCortanaApp" if errorlevel 1 set "Tweak=DisableW11InstHardwareCheck" ) added if "%Tweak%" equ "HideWidgetsIcon" echo.####Applying Hide Taskbar Widgets Icon Tweak################################### Change from: Code: if "%Tweak%" equ "HideChatIcon" Reg add "HKLM\TK_NTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "TaskbarMn" /t REG_DWORD /d "0" /f >nul to Code: if "%Tweak%" equ "HideChatIcon" ( Reg add "HKLM\TK_NTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "TaskbarMn" /t REG_DWORD /d "0" /f >nul Reg add "HKLM\TK_SOFTWARE\Policies\Microsoft\Windows\Windows Chat" /v "ChatIcon" /t REG_DWORD /d "3" /f >nul ) and from Code: if "%Tweak%" equ "HideWidgetsIcon" ( Reg add "HKLM\TK_NTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "TaskbarDa" /t REG_DWORD /d "0" /f >nul Reg add "HKLM\TK_SOFTWARE\Policies\Microsoft\Windows\Windows Chat" /v "ChatIcon" /t REG_DWORD /d "3" /f >nul ) to Code: if "%Tweak%" equ "HideWidgetsIcon" ( Reg add "HKLM\TK_NTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "TaskbarDa" /t REG_DWORD /d "0" /f >nul )
Will check out, it seems the ConvertReg.ps1 needs to run twice for reg files containing CurrentControlSet.
If the HostBuild is less than 1903 then it will use the ReleaseId value and if it is greater than and equal to 1903 it will use DisplayVersion. or you can change it like this Code: if "%HostBuild%" leq "1809" ( for /f "tokens=3 delims= " %%k in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "ReleaseId" ^| find "REG_SZ"') do (set HostDisplayVersion=%%k) ) if "%HostBuild%" geq "1903" ( for /f "tokens=3 delims= " %%k in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "DisplayVersion" ^| find "REG_SZ"') do (set HostDisplayVersion=%%k) ) For Manual Setup removal both will work but have chosen the default index. For renaming you need the current directory to be the parent of the directory you are renaming otherwise it won't work that's why used the move which does the same function.
I was right. Replace CurrentControlSet with ControlSet001. Code: [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server] "fDenyTSConnections"=dword:00000001 "updateRDStatus"=dword:00000000 [HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SCMConfig] "EnableSvchostMitigationPolicy"=dword:00000001 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters] "MaxNegativeCacheTtl"=dword:00000000 "NegativeCacheTime"=dword:00000000 "NetFailureCacheTime"=dword:00000000 "NegativeSOACacheTime"=dword:00000000 Advice: don't play with DNSCache parameters. Here are some tweaks if you really need some: Code: [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile] "NetworkThrottlingIndex"=dword:00000005 [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Tcpip\Parameters] "DisableTaskOffload"=dword:00000001 "EnableDCA"=dword:00000001 "EnableDeadGWDetect"=dword:00000001 "EnableTCPA"=dword:00000001 "EnableWSD"=dword:00000000 "KeepAliveInterval"=dword:000007d0 "KeepAliveTime"=dword:00493e0 "MaxHashTableSize"=dword:0000ffdc "MaxUserPort"=dword:0000ffdc "StrictTimeWaitSeqCheck"=dword:00000001 "SynAttackProtect"=dword:00000001 "Tcp1323Opts"=dword:00000001 "TcpMaxConnectResponseRetransmissions"=dword:00000003 "TcpMaxDataRetransmissions"=dword:00000003 "TcpTimedWaitDelay"=dword:0000001e [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Tcpip\ServiceProvider] "LocalPriority"=dword:0000000a "HostsPriority"=dword:0000000b "DnsPriority"=dword:0000000c [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSMQ\Parameters] "TCPNoDelay"=dword:00000001 [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Dnscache\Parameters] "MaxCacheTtl"=dword:00005460 "MaxCacheEntryTtlLimit"=dword:00005460 "MaxSOACacheEntryTtlLimit"=dword:00000005
No. You do not have to change anything, in that sense. I just wanted to understand if you were using the Build ID or ReleaseId. However, for branch id will be a problematic to detect geq 1903, as it will appear 20h1, 21h1, etc and will not work. It would have to be something like lss 19041 geq 19041 to stay OK. and the previous way would have to be leq 1909 gtr 1909 Because in Build 18363 there is also no "DisplayVersion" registry entry. or lss 2004 geq 2004 But above that, I suppose will give the problem described above 20h1, 21h1, etc. Maybe I'm very mistaken. EDIT: I got home now and went to test. Code: HostOSName : Microsoft Windows 10 Pro HostEdition : Professional HostBuildBranch (BuildBranch) : 19h1_release HostReleaseVersion (ReleaseId) : 1909 HostDisplayVersion (ReleaseId) : 1909 ERRO: O sistema não pôde localizar a chave do Registro ou valor especificado. HostDisplayVersion (DisplayVersion) : 1909 HostVersion : 10.0 HostBuild : 18363 HostServicePackBuild : 1854 HostInstallationType : Client HostArchitecture : x64 HostLanguage : pt-BR Note: "Error: The system could not find the registry key or specified value." For DisplayVersion value. Then HostDisplayVersion is sets like HostReleaseVersion. To correct the error I just put the following condition: if "%HostDisplayVersion%" equ "" I could have used the ">nul" Code: for /f "tokens=3 delims= " %%j in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /f "ReleaseId" ^| find "REG_SZ"') do (set HostReleaseVersion=%%j & if "%%j" lss "2004" set HostDisplayVersion=%%j) if "%HostDisplayVersion%" equ "" for /f "tokens=3 delims= " %%k in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "DisplayVersion" ^| find "REG_SZ"') do (set HostDisplayVersion=%%k) Code: HostOSName : Microsoft Windows 10 Pro HostEdition : Professional HostBuildBranch (BuildBranch) : vb_release HostReleaseVersion (ReleaseId) : 2009 HostDisplayVersion (ReleaseId) : HostDisplayVersion (DisplayVersion) : 21H2 HostVersion : 10.0 HostBuild : 19044 HostServicePackBuild : 1288 HostInstallationType : Client HostArchitecture : x64 HostLanguage : pt-BR I believe I was wrong. Strings 20h1, 20h2, 21h1, etc. are only in Reg Query for "DisplayVersion" value. In case you use it for the "ReleaseId" value everything is right. So I put the commands in the order, in which it was displayed on screen in my test. And it was like this: Code: :: Setting Host OS version, architecture and language variables set HostOSName= set HostEdition= set HostBuildBranch= set HostReleaseBranch= set HostDisplayVersion= set HostVersion= set HostBuild= set HostServicePackBuild= set HostInstallationType= set HostArchitecture= set HostLanguage= for /f "tokens=1 delims=" %%p in ('wmic os get Caption ^| find /v "Caption"') do (for /f "delims=" %%b in ("%%p") do (set "HostOSName=%%~nb")) for /f "tokens=3 delims= " %%l in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "EditionID" ^| find "REG_SZ"') do (set "HostEdition=%%l") for /f "tokens=3 delims= " %%j in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "BuildBranch" ^| find "REG_SZ"') do (set HostBuildBranch=%%j) for /f "tokens=3 delims= " %%j in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /f "ReleaseId" ^| find "REG_SZ"') do (set /A HostReleaseVersion=%%j & if "%%j" lss "2004" set /A HostDisplayVersion=%%j) if "%HostDisplayVersion%" equ "" for /f "tokens=3 delims= " %%k in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "DisplayVersion" ^| find "REG_SZ"') do (set HostDisplayVersion=%%k) for /f "tokens=4-5 delims=. " %%s in ('ver 2^>nul') do (set "HostVersion=%%s.%%t") for /f "tokens=1 delims=" %%i in ('wmic os get BuildNumber ^| find /v "BuildNumber"') do (for /f "delims=" %%b in ("%%i") do (set /a HostBuild=%%~nb)) for /f "tokens=3 delims= " %%r in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "UBR" ^| find "REG_DWORD"') do (set /a HostServicePackBuild=%%r) for /f "tokens=3 delims= " %%m in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "InstallationType" ^| find "REG_SZ"') do (set HostInstallationType=%%m) if exist "%SystemROOT%\SysWOW64" (set "HostArchitecture=x64") else (set "HostArchitecture=x86") rem for /f "tokens=6 delims= " %%o in ('DISM /Online /English /Get-Intl ^| findstr /i /C:"Default system UI language"') do (set "HostLanguage=%%o") for /f "tokens=3 delims= " %%o in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\CommonGlobUserSettings\Control Panel\International" /v "LocaleName" ^| find "REG_SZ"') do (set "HostLanguage=%%o") Note: I preferred HostOSName through wmic. But I do not know if it's right in Windows 11. Code: echo.Reading Host OS Information... echo. if "%HostBuild%" lss "19041" ( echo.%HostOSName% ^(%HostDisplayVersion%^) - v%HostVersion%.%HostBuild%.%HostServicePackBuild% %HostArchitecture% %HostLanguage% ) else ( echo.%HostOSName% ^(%HostReleaseVersion% %HostDisplayVersion%^) - v%HostVersion%.%HostBuild%.%HostServicePackBuild% %HostArchitecture% %HostLanguage% ) That way I had put it before it was only a palliative for that moment. This way: Code: rem for /f "tokens=3*" %%p in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "ProductName" ^| find "ProductName"') do (if "%HostBuild%" lss "21996" (set "HostOSName=%%p %%q") else (set "HostOSName=%%p 11"))
Have uploaded Toolkit.cmd with quick fix for importing registry settings from registry file would skip renaming the key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\ to HKEY_LOCAL_MACHINE\TK_SYSTEM\ControlSet001\ Now the Registry file is converted twice to fix the CurrentControlSet to ControlSet001.
I noticed that when you delete the Notepad on Windows 11, it is still there but you lose all the associations, I thought it would be the opposite.