Your OOBE.cmd adds to RunOnceEx, right?
Are all the HKLM\RunOnce commands executed before the HKLM\RunOnceEx commands are executed?
If not, wouldn't that registry file break the script?
UPDATE:
I've done further testing. After applying the following reg file:
Code:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"1"="C:\\Windows\\System32\\cmd.exe /c \"echo %date% %time%: HKLM-Run\" >>C:\\setup.log"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce]
"1"="C:\\Windows\\System32\\cmd.exe /c \"echo %date% %time%: HKLM-RunOnce\" >>C:\\setup.log"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\01]
"1"="C:\\Windows\\System32\\cmd.exe /c \"echo %date% %time%: HKLM-RunOnceEx\" >>C:\\setup.log"
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"1"="C:\\Windows\\System32\\cmd.exe /c \"echo %date% %time%: HKCU-Run\" >>C:\\setup.log"
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce]
"1"="C:\\Windows\\System32\\cmd.exe /c \"echo %date% %time%: HKCU-RunOnce\" >>C:\\setup.log"
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\01]
"1"="C:\\Windows\\System32\\cmd.exe /c \"echo %date% %time%: HKCU-RunOnceEx\" >>C:\\setup.log"
The output to the setup.log was the following after restarting twice:
Code:
Fri 02/05/2021 13:43:45.50: HKLM-RunOnceEx
Fri 02/05/2021 13:43:45.57: HKCU-RunOnceEx
Fri 02/05/2021 13:43:45.66: HKLM-RunOnce
Fri 02/05/2021 13:43:56.77: HKLM-Run
Fri 02/05/2021 13:43:57.75: HKCU-Run
Fri 02/05/2021 13:43:57.80: HKCU-RunOnce
Fri 02/05/2021 13:46:23.28: HKLM-RunOnceEx
Fri 02/05/2021 13:46:23.35: HKCU-RunOnceEx
Fri 02/05/2021 13:46:23.44: HKLM-RunOnce
Fri 02/05/2021 13:46:34.57: HKLM-Run
Fri 02/05/2021 13:46:35.47: HKCU-Run
Fri 02/05/2021 13:46:35.51: HKCU-RunOnce
I know it's only two tests and it may not be the same on a fresh install, but it does seem to indicate that HKLM-RunOnceEx is executed before HKLM-RunOnce, which would suggest to me that your OOBE registry fix for computers that don't run OOBE.cmd may not work.