drscouse Posted September 16, 2005 Posted September 16, 2005 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
Martin Zugec Posted September 16, 2005 Posted September 16, 2005 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.
drscouse Posted September 16, 2005 Author Posted September 16, 2005 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
Martin Zugec Posted September 16, 2005 Posted September 16, 2005 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.
drscouse Posted September 16, 2005 Author Posted September 16, 2005 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
drscouse Posted September 16, 2005 Author Posted September 16, 2005 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 @ /HIDSET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceExfor %%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):installREG ADD %KEY% /V TITLE /D "Set Up Software" /fREG ADD %KEY%\001 /VE /D "Nero" /fREG ADD %KEY%\001 /V 01 /D "\"%CDROM%\apps\Nero\Nero.exe\" /silentREG ADD %KEY%\002 /VE /D "Clean & Reboot" /fREG ADD %KEY%\002 /V 5 /D "shutdown.exe -r -f -t 10 -c \"Clean & Reboot\"" /fREG ADD %KEY%\003 /VE /D "Acrobat" /fREG ADD %KEY%\003 /V 01 /D %CDROM%\apps\acrobat\acrobat.exe\ /frundll32.exe iernonce.dll,RunOnceExProcessI dont know if I should rename 003, back to 001, or need to alter the sutdown command... Can you help at all???
Martin Zugec Posted September 16, 2005 Posted September 16, 2005 Try to not run shutdown directly - use cmd instead (put the shutdown command to batch and add pause to last line)
drscouse Posted September 16, 2005 Author Posted September 16, 2005 (edited) 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 September 16, 2005 by drscouse
gunsmokingman Posted September 16, 2005 Posted September 16, 2005 TestShutDown.cmdEcho off && shutdown.exe -r -f -t 10 -ccmdow @ /HIDSET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceExfor %%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):installREG ADD %KEY% /V TITLE /D "Set Up Software" /fREG ADD %KEY%\001 /VE /D "Nero" /fREG ADD %KEY%\001 /V 01 /D "\"%CDROM%\apps\Nero\Nero.exe\" /silentREG ADD %KEY%\002 /VE /D "Clean & Reboot" /fREG ADD %KEY%\002 /V 5 /D "WHERE_EVER_IT_LOCATED:\TestShutDown.cmd"/fREG ADD %KEY%\003 /VE /D "Acrobat" /fREG ADD %KEY%\003 /V 01 /D %CDROM%\apps\acrobat\acrobat.exe\ /frundll32.exe iernonce.dll,RunOnceExProcess
drscouse Posted September 16, 2005 Author Posted September 16, 2005 THANK YOU THANK YOU THANK YOU Works like a charm!!
drscouse Posted September 16, 2005 Author Posted September 16, 2005 (edited) 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 @ /HIDSET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceExfor %%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):installREG ADD %KEY% /V TITLE /D "Set Up Software" /fREG ADD %KEY%\001 /VE /D "Nero" /fREG ADD %KEY%\001 /V 01 /D "\"%CDROM%\software\Nero\Nero.exe\" /silent"REG ADD %KEY%\002 /VE /D "Clean & Reboot" /fREG ADD %KEY%\002 /V 5 /D %systemdrive%\ShutDown.cmdREG ADD %KEY%\003 /VE /D "Acrobat" /fREG ADD %KEY%\003 /V 01 /D "\"%CDROM%\Software\Acrobat Reader\Acrobat.exe\"" /frundll32.exe iernonce.dll,RunOnceExProcessEcho off && shutdown.exe -r -f -t 10Its getting late.. maybe some fresh eyes in the morning will help!! Edited September 16, 2005 by drscouse
Takeshi Posted September 16, 2005 Posted September 16, 2005 REG ADD %KEY%\002 /V 5 /D %systemdrive%\ShutDown.cmdIt shouldn't be REG ADD for the ShutDown.cmd, just run the cmd there and then.
nakira Posted September 17, 2005 Posted September 17, 2005 Just add a pause command to shutdown.cmd@echo off&&shutdown.exe -r -f -t 5&&pause
drscouse Posted September 17, 2005 Author Posted September 17, 2005 @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!!
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now