Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

What is easiest way to run RunOnceEx again?

Featured Replies

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


Hmmm, dont understand - ROE is based on components, every component is removed from registry when it is processing (not entry, just target)... So if you create one looong ROE with internal restarts, it should continue after the place where restart occured.

  • Author

Thanks.. I didnt know that you could simply interrupt the process by rebooting half way through it... and it would carry on from the next item after the reboot command.

May have to test that out.. Cheers

Just have a look to registry structure... There are keys, that are independent on each other, so I dont see a reason why this shouldnt work.

  • Author

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

  • Author

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

Try to not run shutdown directly - use cmd instead (put the shutdown command to batch and add pause to last line)

  • Author

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

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

  • Author

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

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

It shouldn't be REG ADD for the ShutDown.cmd, just run the cmd there and then.

Just add a pause command to shutdown.cmd

@echo off&&shutdown.exe -r -f -t 5&&pause

  • Author
@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

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.