Issue with RunOnce in the Post-Setup.

tired-it

Member
Messages
221
Reaction score
20
Currently trying to debug the Post-Setup section of a Windows 11 23H2 ISO.

Previously the RunOnce script was not executing on the first user login. A few changes later the Windows install became stuck on "Just a moment." Moved a command to the User section and now the install completes, but the Post-Setup dialogue box and command prompt show and just stay there... I can cancel it out, but it should not be popping up to begin with. The Post-Setup box says "cmd" and "cleaning up," but never makes any progress.

I confirmed that all the programs installed fine as far as I can tell. The wifi commands and files succeeded. The background image is applied. The delete commands are working fine.

The only thing left is the RunOnce script. I have the script set to merge a .REG file that is previously copied into the mounted directory. This was mostly copied from Garlin's explanation and suggestion for making certain changes post-logon. The problem is that the first user to log on no longer sees those changes occurring. If I sign out and enter another profile, the script runs fine because I can visibly see the changes being made shortly after logging on.

Any idea what is going on? Is there a way to generate a log file that I can try to diagnose the issue with? I originally had the RunOnce script in the User section of Post-Setup, should I move it back? Is being in the Machine section the cause of of the dialogue and prompt showing up on the first user logon?

Quick edit: I'd like to mention that I have been making updated ISOs with every new cumulative update from MS while using the same presets. It was only the past month or so that I noticed that the RunOnce script was seemingly not working the same anymore.
 

Attachments

Solution
I looked at the XML and jumped to the bottom of post-setup. I noticed the command prompt you mentioned, which is set to disable the radio manager service. I opened a command prompt and typed in what you have there and it left the window open afterward, which means it will cause a new operating system installation to hang when this command is placed in the Machine (Before logon) section of NTLite's post-setup. Prompts are not allowed to appear there, since there isn't any manual user input to exit them via mouse or keyboard.

For the rmsvc service tweak, I see 2 easy solutions. My preferred is to get rid of all post-setup, scripts, etcetera and integrate things directly, which could be done here by deleting this post-setup command and...
I looked at the XML and jumped to the bottom of post-setup. I noticed the command prompt you mentioned, which is set to disable the radio manager service. I opened a command prompt and typed in what you have there and it left the window open afterward, which means it will cause a new operating system installation to hang when this command is placed in the Machine (Before logon) section of NTLite's post-setup. Prompts are not allowed to appear there, since there isn't any manual user input to exit them via mouse or keyboard.

For the rmsvc service tweak, I see 2 easy solutions. My preferred is to get rid of all post-setup, scripts, etcetera and integrate things directly, which could be done here by deleting this post-setup command and using its registry key from the spoiler below. The other option to try is altering the sc config command, changing the ending from "DISABLED" into "DISABLED & exit" without quotes, which closes the window after it runs.
; Start > Windows Administrative Tools > Services > Radio Management Service > Disabled
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RmSvc]
"Start"=dword:00000004

If the batch file opens any windows and leaves them behind after it finishes running, then those would need to be closed too. Alternatively, all post-setup items can moved to User (After logon) and most post-setup issues will go away, because user input is allowed there. Even when using the User (After logon) post-setup, any opened windows that are not automatically exited will still require a user to manually address them.
 
Last edited:
Solution
I looked at the XML and jumped to the bottom of post-setup. I noticed the command prompt you mentioned, which is set to disable the radio manager service. I opened a command prompt and typed in what you have there and it left the window open afterward, which means it will cause a new operating system installation to hang when this command is placed in the Machine (Before logon) section of NTLite's post-setup. Prompts are not allowed to appear there, since there isn't any manual user input to exit them via mouse or keyboard....
Huh, and here I was thinking it was the RunOnce script. I was not aware that the service tweak was creating a user prompt. I had moved it to the User execution in a more recent test and was still experiencing some oddities.

I too prefer to remove as many post-setup commands and scripts as possible and that registry entry worked perfectly. The RunOnce script is now triggering on the first user logon. Funny how one command was causing so many things to break, whoops. Thank you.

I had been trying a solution like that for a while too. Apparently, disabling that service in NTLite caused my installation to hang. There are a few settings that I wish had viable registry keys too, but alas Windows is a quirky creature to work with.
 
Back
Top