I am having difficulty properly configuring the RunOnce commands. I deploy a master sysprepped Windows XP Pro SP3 WIM image to multiple clients using WinPE, and sometimes I would like to add an additional reboot after the initial logon. I've added a registry add command to either the HKLM or HKCU hives (\Software\Microsoft\Windows\CurrentVersion\RunOnce /v launch /t REG_SZ /d "C:\Start\Launch.cmd final") as one of the final Sysprep.INF GUIRunOnce commands . If I add it to the HKLM hive, the RunOnce command launches after reboot, but other autostart (run) applications are held up waiting for the routine to complete, which is undesireable. If I add the command instead to the HKCU hive, then the new RunOnce command attempts to launch immediately after added and prior to the next reboot/logon unless I follow it with a shutdown command, which appears to interrupt the immediate launching. I am using the latter method for now, but dislike the behavior. Can anyone explain this behavior or perhaps offer a solution?
Page 1 of 1
RunOnce Immediately Launches After Adding
#2
Posted 08 February 2012 - 06:38 AM
It's messy, but you can poke entries into HKLM runonce from HKCU runonce, which get processed on the next reboot:
SET KEY=HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce
REG ADD %KEY% /V w /d "reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce /V speak /d \"wscript %systemroot%\speak.vbs \\\"installation complete\\\"\" /f" /f
REG ADD %KEY% /V z /D "shutdown.exe -r -f -t 60 -c \"1\"" /f
SET KEY=HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce
REG ADD %KEY% /V w /d "reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce /V speak /d \"wscript %systemroot%\speak.vbs \\\"installation complete\\\"\" /f" /f
REG ADD %KEY% /V z /D "shutdown.exe -r -f -t 60 -c \"1\"" /f
- ← how to add recovery console for unattended xp in source i386
- Unattended Windows 2000/XP/2003
- Makecab & Expand right click functionality →
Share this topic:
Page 1 of 1



Help
Back to top









