Jump to content

What is easiest way to run RunOnceEx again?


Recommended Posts

Im having trouble trying to figure out the best way to get RunOnceEx to run again after its inital completion, and reboot.

During the first run, upon first bootup, I install drivers... and all hotfixes... I then want to reboot, auto logon again, and execute RunOnceEx again, to install all my apps... cleanup etc...

I think easiest way would be to move the 2nd RunOnceEx into my account statup folder... and at the end of this script, delete itself (although I dont know if this is possible - to delete a file that is running, I would think not?), so it would not run again, or each time pc rebooted. If so, how would I write the command to copy this file??

Anyone got any advice, or tips to accomplsih the same end result..??

Thanks

Link to comment
Share on other sites


Never really knew "how" it did what it did... I monitored the regkey, and stuck pauses in the runonceex.cmd and saw how it worked...

Makes sense now!!

Thanks alot for that bit of info, its given me an insight in how the script/command worked..

Cheers

Link to comment
Share on other sites

Ive been testing with 2 progs, to see if it will install one, reboot then install the other. However, it just wants to install the second one, after it has started the shutdown procedure...

I may need a hand with the scripting, as Ive just been copying/modifying the commands to see if they will work, and I may not have them right.

cmdow @ /HID

SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx

for %%a in (z y x w v u t s r q p o n m l k j i h g f e d c) do if exist %%a:\apps (

set CDROM=%%a:

goto install

)

:install

REG ADD %KEY% /V TITLE /D "Set Up Software" /f

REG ADD %KEY%\001 /VE /D "Nero" /f

REG ADD %KEY%\001 /V 01 /D "\"%CDROM%\apps\Nero\Nero.exe\" /silent

REG ADD %KEY%\002 /VE /D "Clean & Reboot" /f

REG ADD %KEY%\002 /V 5 /D "shutdown.exe -r -f -t 10 -c \"Clean & Reboot\"" /f

REG ADD %KEY%\003 /VE /D "Acrobat" /f

REG ADD %KEY%\003 /V 01 /D %CDROM%\apps\acrobat\acrobat.exe\ /f

rundll32.exe iernonce.dll,RunOnceExProcess

I dont know if I should rename 003, back to 001, or need to alter the sutdown command...

Can you help at all???

Link to comment
Share on other sites

Excuse my noobiness... this is all new territory for me...

Getting this far was a bit of a learning curve...lol...

Any chance you could expand a bit more?

So, I need to write a shutdown.bat (shutdown -r ?)and call it from RunOnceEx, like another app??, ok.. where do I put the pause???

Thanks

Edited by drscouse
Link to comment
Share on other sites

TestShutDown.cmd

Echo off && shutdown.exe -r -f -t 10 -c
cmdow @ /HID

SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx

for %%a in (z y x w v u t s r q p o n m l k j i h g f e d c) do if exist %%a:\apps (

set CDROM=%%a:

goto install

)

:install

REG ADD %KEY% /V TITLE /D "Set Up Software" /f

REG ADD %KEY%\001 /VE /D "Nero" /f

REG ADD %KEY%\001 /V 01 /D "\"%CDROM%\apps\Nero\Nero.exe\" /silent

REG ADD %KEY%\002 /VE /D "Clean & Reboot" /f

REG ADD %KEY%\002 /V 5 /D "WHERE_EVER_IT_LOCATED:\TestShutDown.cmd"/f

REG ADD %KEY%\003 /VE /D "Acrobat" /f

REG ADD %KEY%\003 /V 01 /D %CDROM%\apps\acrobat\acrobat.exe\ /f

rundll32.exe iernonce.dll,RunOnceExProcess

Link to comment
Share on other sites

Had it working once, after a slight modification.. since then, the -f switch does not seem to be terminating the current process, and the next app is still installing...

I swear it worked fine on my test system, before I tried it on my UaCD!!

Driving me nuts!!

cmdow @ /HID

SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx

for %%a in (z y x w v u t s r q p o n m l k j i h g f e d c) do if exist %%a:\software (

set CDROM=%%a:

goto install

)

:install

REG ADD %KEY% /V TITLE /D "Set Up Software" /f

REG ADD %KEY%\001 /VE /D "Nero" /f

REG ADD %KEY%\001 /V 01 /D "\"%CDROM%\software\Nero\Nero.exe\" /silent"

REG ADD %KEY%\002 /VE /D "Clean & Reboot" /f

REG ADD %KEY%\002 /V 5 /D %systemdrive%\ShutDown.cmd

REG ADD %KEY%\003 /VE /D "Acrobat" /f

REG ADD %KEY%\003 /V 01 /D "\"%CDROM%\Software\Acrobat Reader\Acrobat.exe\"" /f

rundll32.exe iernonce.dll,RunOnceExProcess

Echo off && shutdown.exe -r -f -t 10

Its getting late.. maybe some fresh eyes in the morning will help!!

Edited by drscouse
Link to comment
Share on other sites

@echo off&&shutdown.exe -r -f -t 5&&pause
that hit the spot!!

Thanks for all your help everyone.. got there in the end...

I think originally I did have a pause in there, but I had put it in there to see what was happening, and didnt know it was vital for it to work in that way. I removed it when I had finished seeing what was going on, but just didnt realise that was why it stopped working!!

The penny never dropped!! :D:D:D

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...