MSFN Forum: How to get Run/RunOnce keys working? - MSFN Forum

Jump to content



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

How to get Run/RunOnce keys working? Rate Topic: -----

#1 User is offline   [TiLT] 

  • Newbie
  • Group: Members
  • Posts: 15
  • Joined: 07-March 08

Posted 16 March 2008 - 02:51 PM

I can add the keys fine after Vista is installed, but if I add them in during setup they're wiped clean before the first user logs on.

the HKCU RunOnce branch is actually removed in it's entirety. but it works fine if I add the key manually after the user logs on.


#2 User is offline   [TiLT] 

  • Newbie
  • Group: Members
  • Posts: 15
  • Joined: 07-March 08

Posted 17 March 2008 - 01:47 AM

woot! got it working. HKCU Run & RunOnce were being obliterated before first logon (even when I locked down permissions on them beforehand), but HKLM RunOnce stays intact.

so I used HKLM RunOnce to run a script that adds a key to HKCU RunOnce and then reboots.

I needed to use both because certain pesky registry tweaks will only "stick" if run from HKCU, while others only "stick" when run from HKLM.

Had to combine setupcomplete.cmd with the RunOnce keys to finally set all the keys I wanted.

specialize, oobeSystem, and even auditUser passes were all (mostly) worthless.

(this was all with SP1 RTM btw)

P.S. - Another thing I noticed early on, you can't use regedit to import the Run\RunOnce keys, they won't be written. Instead I used reg add or regini. I never tried reg import.

This post has been edited by [TiLT]: 17 March 2008 - 01:53 AM


#3 User is offline   MAVERICKS CHOICE 

  • The Guy from Aus
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1,604
  • Joined: 14-November 03

  Posted 17 March 2008 - 02:15 AM

View Post[TiLT], on Mar 17 2008, 05:47 PM, said:

woot! got it working. HKCU Run & RunOnce were being obliterated before first logon (even when I locked down permissions on them beforehand), but HKLM RunOnce stays intact.

so I used HKLM RunOnce to run a script that adds a key to HKCU RunOnce and then reboots.

I needed to use both because certain pesky registry tweaks will only "stick" if run from HKCU, while others only "stick" when run from HKLM.

Had to combine setupcomplete.cmd with the RunOnce keys to finally set all the keys I wanted.

specialize, oobeSystem, and even auditUser passes were all (mostly) worthless.

(this was all with SP1 RTM btw)

P.S. - Another thing I noticed early on, you can't use regedit to import the Run\RunOnce keys, they won't be written. Instead I used reg add or regini. I never tried reg import.


Glad ya got it workin..how about a tute for the few not in the know?

#4 User is offline   [TiLT] 

  • Newbie
  • Group: Members
  • Posts: 15
  • Joined: 07-March 08

Posted 17 March 2008 - 02:53 AM

use Windows\Setup\Scripts\setupcomplete.cmd to "reg add" runonce.cmd to the HKLM RunOnce

runonce.cmd then sets the HKCU RunOnce cmd that I want via "reg add" and reboots via shutdown /r.
I run all .cmd with hidec and they work fine that way.

Edit: You may be able to set the HKLM RunOnce key at another time in your unattended.xml too, but that's how I did it since I was using setupcomplete.cmd already. Hidec also works fine for batch files executed from your unattended.xml

This post has been edited by [TiLT]: 17 March 2008 - 03:02 AM


#5 User is offline   MAVERICKS CHOICE 

  • The Guy from Aus
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1,604
  • Joined: 14-November 03

  Posted 17 March 2008 - 04:20 AM

View Post[TiLT], on Mar 17 2008, 07:53 PM, said:

use Windows\Setup\Scripts\setupcomplete.cmd to "reg add" runonce.cmd to the HKLM RunOnce

runonce.cmd then sets the HKCU RunOnce cmd that I want via "reg add" and reboots via shutdown /r.
I run all .cmd with hidec and they work fine that way.

Edit: You may be able to set the HKLM RunOnce key at another time in your unattended.xml too, but that's how I did it since I was using setupcomplete.cmd already. Hidec also works fine for batch files executed from your unattended.xml


Look I know where you are coming from but a simple tutorial would be helpful to some.

#6 User is offline   ajua 

  • Custom Installer Maker
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 1,260
  • Joined: 16-April 05

Posted 17 March 2008 - 08:43 PM

View PostMAVERICKS CHOICE, on Mar 17 2008, 04:20 AM, said:

View Post[TiLT], on Mar 17 2008, 07:53 PM, said:

use Windows\Setup\Scripts\setupcomplete.cmd to "reg add" runonce.cmd to the HKLM RunOnce

runonce.cmd then sets the HKCU RunOnce cmd that I want via "reg add" and reboots via shutdown /r.
I run all .cmd with hidec and they work fine that way.

Edit: You may be able to set the HKLM RunOnce key at another time in your unattended.xml too, but that's how I did it since I was using setupcomplete.cmd already. Hidec also works fine for batch files executed from your unattended.xml


Look I know where you are coming from but a simple tutorial would be helpful to some.


that would be nice. i don't have the time to try it right now. I use FirstLogonCommanfs for now and works great. Im now into SP1 without any hassles.

Share this topic:


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

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



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