Jump to content

Adding more RunOnceEX during RunOnceEx


Recommended Posts


Yes it is possible (I use the following method). Once RunOnceEx starts, any new keys you add will be run during the NEXT boot.

Say you call your original RunOnceEx entries 0001, 0005, 1000, 4000 and 6000... To add some for next boot, I prefix each entry with B2 (or whatever number boot it is).

So you would import entries called B21000, B22000, B26000 and B28010... Get the idea?

Link to comment
Share on other sites

Yes it is possible (I use the following method). Once RunOnceEx starts, any new keys you add will be run during the NEXT boot.

Say you call your original RunOnceEx entries 0001, 0005, 1000, 4000 and 6000... To add some for next boot, I prefix each entry with B2 (or whatever number boot it is).

So you would import entries called B21000, B22000, B26000 and B28010... Get the idea?

thanks :thumbup

nice solution

Link to comment
Share on other sites

Hmmm.....

a bit confused:

For adding more runonceex's..would you have to have a reg entry at the end of your original runonceex.cmd that "calls" another .reg file? Or are you saying that by having the naming scheme "b2001" it will automatically run those on 2nd bootup?

Ran

Link to comment
Share on other sites

Call a reg merge from RunOnce to create a RunOnceEx keys and it will be effective on the next logon or reboot.

RunOnce entries are enumerated after RunOnceEx's are. Having the reg merge done from RunOnce will simply create the entries in RunOncex and as RunOnceEx aready had its turn, the entries will not be executed till next logon or Reboot.

Good Luck!

Link to comment
Share on other sites

1. Create a .reg file with following and save it as C:\RunOnceEx.reg

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\0001]
"RunOnceEx"="Notepad.exe"

2. Create following String Value entry under RunOnce key:

ValueName = RunOnceEx and its value as Regedit /s C:\RunOnceEx.reg

OR Alternatively to achieve the same create another .reg file as below and run it by double clicking on it.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce]
"RunOnceEx"="Regedit /s C:\\RunOnceEx.reg"

The RunOnce reg entry when executed, after all RunOnceEx entries are executed(if any), will create entry to run Notepad in RunOnceEx and will not be initiated till next logon or reboot. At the next logon/reboot, RunOnceEx entries will be enumerated and as a result Notepad will fire up.

Link to comment
Share on other sites

Here is an example of how is should be laid out (note: after RunOnceEx has started, you cannot add entries to the CURRENT boot. Any entries you add will install NEXT boot regardless of wether RunOnceEx has finished or not).

1. RunOnceEx.cmd file (imported during CMDLINES):

regedit.exe /s "RunOnceExFirstBoot.reg"

2. RunOnceExFirstBoot.reg (run from RunOnceEx.cmd during CMDLINES):

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx]
"Title"="Post Setup FIRST Boot"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\0001]
@="RunOnceEx Second Boot"
"1"="RunOnceEx2.cmd"

3. RunOnceEx2.cmd (executed during first boot):

regedit /s 'RunOnceExSecondBoot.reg"

4. RunOnceExSecondBoot.reg (run from RunOnceEx2.cmd on first boot):

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx]
"Title"="This can be whatever but won't actually be displayed"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\B20001]
@="A Program Run On SECOND Boot"
"1"="SomeProgram.exe"

Note: The title for the RunOnceEx window on second boot won't be displayed as Windows deletes the Title value when it finishes executing all the RunOnceEx entries.

If you need anymore help, let me know.

Link to comment
Share on other sites

The easy way :

At the bottom of your first RunonceEx.cmd file put this :

REG ADD %KEY%\098 /V 1 /D "%Systemdrive%\Install\Secondrun.cmd" /f

in "secondrun.cmd" you just put your applications in the same way as you did in Runonceex.cmd. remember to put a line to reboot windows, at the end of your "secondrun.cmd" file, like :

Shutdown.exe -r -f -t 60 -c "windows will restart in 1 min..."

Works for me.

Link to comment
Share on other sites

That is easier but you will have NO IDEA about what program is being installed on second boot.

The way I outlined, you still have the RunOnceEx window with information on what is currently being installed.

Link to comment
Share on other sites

You DO have an idea of whats being installed.

First of all, you write your applications that you like to be installed on the second boot in "secondrun.cmd" and second they will be run from Runonceex exactly as the first portion did.

I am not saying your method is wrong or anything, just informing how it also can be done.

Link to comment
Share on other sites

  • 4 weeks later...

I've had sucess with Splitting the Runonex entries in 2 flavors by my UnattendXP application. I prefer the first so I'll stick with it for now unless someone can show me why it be better to use different method.

  • 1. It executes first then second one as it starts deletes the entries from first and pops up with new Title and all. This method allow's it to load desktop while it is running which is Ok by me as it install's everything and then reboot's.
  • 2. It executes first then second one comes up with first still showing. It even came up behind first one in one test run. Thats why i like # 1

No reboot, its all done first time using either method.

Link to comment
Share on other sites

  • 2 months later...
I've had sucess with Splitting the Runonex entries in 2 flavors by my UnattendXP application. I prefer the first so I'll stick with it for now unless someone can show me why it be better to use different method.
  • 1. It executes first then second one as it starts deletes the entries from first and pops up with new Title and all. This method allow's it to load desktop while it is running which is Ok by me as it install's everything and then reboot's.
  • 2. It executes first then second one comes up with first still showing. It even came up behind first one in one test run. Thats why i like # 1

No reboot, its all done first time using either method.

Could you possibly give an example of your first method, how you are calling the second cmd? :hello:

Regards

Maverick

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...