Jump to content

runonce on second boot

Recommended Posts

I know I have seen it before, but con not find it now. How do you run a .BAT file on the second boot of the Admin account. I can not get some programs to install on the first attemt so I want to try the second one.

I would really like the file to start when the Desktop is all the way up.


Link to comment
Share on other sites

Create a batch file and place it under the GuiRunOnce entry within your answer file. for eg:-


runonce.bat (located in the %cdrom%\$oem$\$1 directory) could consist of the following lines:-

echo off

start /wait %systemdrive%\programA.exe


The above would run your software after the user shell has initiated, but on the first boot.

Or create a batch file called runonce.bat which could look something like this....

SET KEY=HKCU\\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce

REG ADD %KEY% /V "App Install" /D "Currently installing....." /f

REG ADD %KEY%01 /VE /D "programA" /f
REG ADD %KEY%01 /V "programA" /D "location of program to launch goes here" /f

shutdown -r -t 00


Go ahead and put the same entry as above in your guirunonce section of your answer file and place runonce.bat in %cdrom%\$OEM$\$1\

Place as many programs as you like in the batch file reg entries, just increment them %KEY%01, %KEY%02, %KEY%03...etc. Your system should boot automatically after the desktop has loaded for the first time and on second boot your app installations should launch (in theory!). The 00 at the end is the time in seconds the system waits before reboot, in this case, zero seconds, which is a little too quick, maybe! Change it to suite, or omitt the shutdown line at the end and reboot manually.

I am a bit rusty on this and there may be a blatently obvious, easier solution. But this is all could think of right now.

What software is failing to launch at RunOnceEx or on first boot? How are you trying to initiate the software installation(s)?

Link to comment
Share on other sites

I am doing a runonce that installs all my apps for me. I did not wnat to intergrate them.

IE7 is part of this. If I let the system boot all the way up and run the install.bat everything works fine. If I let GuiRunOnce start the install.bat IE7 does not install properly and I have to reinstall it.

Link to comment
Share on other sites

To get round any problems that IE7 poses, I usually intergrate it, then run a batch file to replace the newly installed iernonce.dll file with the older IE6 iernonce.dll. Then I go ahead and have RunOnceEx on the next boot take care of installing all of my apps.

I have just one batch file that does everything in one. That way, IE7 is completely intergrated, which saves install time and it does not interfere with any other app installation after XP has installed.

If your installing IE7 as an unattended install & you don't have an internet connection, it may fail due to the unavailablity of a connection to download files to update and install. Or there could be other software using or locking the registry perhaps, this will cause IE7 to possible fail.

I'm not entirely sure of this, but it is just an idea of what might be going on, depending on how your installing the software or in what order you are doing so.

Edited by silacomalley
Link to comment
Share on other sites

i am kinda having the same problem, but maybe alittle different. i have my dvd created and upon the first bootup i run wpi and install some software and settings. that is all working great. however:

i have changed my autologin to 3 now. and i would like to be able to unattendedly install some more apps during each boot. im not sure how to set this up, so that it know upon each boot what to load.


boot1 = adobe reader - then reboot

boot2 = office - then reboot

boot3 = photoshop - done

im not sure if i can load wpi again after the 2nd boot, but any help would be great, thank you very much...


Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.

  • Create New...