MSFN Forum: RunOnce Immediately Launches After Adding - MSFN Forum

Jump to content


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

RunOnce Immediately Launches After Adding Rate Topic: -----

#1 User is offline   luftacos 

  • Group: Members
  • Posts: 1
  • Joined: 06-February 12
  • OS:none specified
  • Country: Country Flag

Posted 07 February 2012 - 04:58 PM

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?


#2 User is offline   uid0 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 348
  • Joined: 12-June 06

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

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2013 msfn.org
Privacy Policy