Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

RunOnce Immediately Launches After Adding

- - - - -

  • Please log in to reply
1 reply to this topic

#1
luftacos

luftacos
  • Member
  • 1 posts
  • Joined 06-February 12
  • OS:none specified
  • Country: Country Flag
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?


How to remove advertisement from MSFN

#2
uid0

uid0

    Advanced Member

  • Member
  • PipPipPip
  • 357 posts
  • Joined 12-June 06
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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users