Jump to content

Run .cmd on secound reboot, after RunOnceEx.cmd!?


Recommended Posts


Hmm wouldnt this just run the batch after all applications has been installed?

Like before cleanup and restart .cmd.

I mean that is should install all applications, then run cleanup.cmd, reboot and launch another "installing drivers" RunOnceEx.cmd and another celanup.cmd" and THEN it reboots to windows.

Link to comment
Share on other sites

you probably in your batch have a 'rundll32 iernonce.dll,RunOnceExProcess' which tells windows to run RunOnceEx otherwise it would automatically run on the next reboot. So if you just imported teh settings for the second batch without telling it to run, it will automatically run on the next reboot.

Link to comment
Share on other sites

mmkay, I find myself slightly confused at this (I know the method, but the posts thus far....)

@BoardBabe

RunOnceEX deletes the keys after it has executed them. This is good for you.

In your first RunOnceEX.cmd file, add an entry to your other one. As in, another entry of the form

%KEY%\070

I didn't do the full thing, but hopefully you understand.

It that command to execute the SECOND CMD file. Have the numbering so it's at the end. And then after words CLEANUP.CMD should run and restart. Upon restart the second RunOnceEX will start up for your drivers.

The numbering in the second CAN startover, infact I recommend it. Just be careful in your first cleanup.cmd NOT to delete the stuff you need for your second RunOnceEX instance

Link to comment
Share on other sites

Im sorry actually i dont see where your going. Can you explain? I'll past my full files as they are now. I hope i got it right ;) (its in norwegian though, but youll get it)

RunOnceEx.cmd

cmdow @ /HID
@echo off

IF EXIST D:\WIN51 set CDROM=D:
IF EXIST E:\WIN51 set CDROM=E:
IF EXIST F:\WIN51 set CDROM=F:
IF EXIST G:\WIN51 set CDROM=G:
IF EXIST H:\WIN51 set CDROM=H:
IF EXIST I:\WIN51 set CDROM=I:
IF EXIST J:\WIN51 set CDROM=J:

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

REG ADD %KEY% /V TITLE /D "Installerer programvare" /f

REG ADD %KEY%\005 /VE /D "Enhetsdrivere" /f
REG ADD %KEY%\005 /V 1 /D "%CDROM%\$OEM$\installer_drivere.cmd" /f

REG ADD %KEY%\010 /VE /D "Microsoft .NET Framework v1.1 SP1" /f
REG ADD %KEY%\010 /V 1 /D "%systemdrive%\Drivers\NetFramework\netfx.msi /QB" /f
REG ADD %KEY%\010 /V 2 /D "%Systemdrive%\Drivers\NetFramework\NDP1.1sp1-KB867460-X86.exe /Q" /f

REG ADD %KEY%\015 /VE /D "MSN Messenger 6.2" /f
REG ADD %KEY%\015 /V 1 /D "%CDROM%\Programvare\MSN\MsnMsgs.msi /QB" /f

REG ADD %KEY%\020 /VE /D "Microsoft Office 2003 Professional" /f
REG ADD %KEY%\020 /V 1 /D "%CDROM%\Programvare\Office2003\PRO11.msi /QB" /f

REG ADD %KEY%\025 /VE /D "Adobe Acrobat Reader 6" /f
REG ADD %KEY%\025 /V 1 /D "%CDROM%\Programvare\AdobeReader6\installer.cmd" /f

REG ADD %KEY%\030 /VE /D "Adobe Illustrator CS" /f
REG ADD %KEY%\030 /V 1 /D "\"%CDROM%\Programvare\IllustratorCS\Adobe Illustrator CS\setup.exe\" -S -f1 \"%CDROM%\Programvare\IllustratorCS\Adobe Illustrator CS\setup.iss\" -f2 \"%SystemRoot%\Install\Illustrator.log\"" /f

REG ADD %KEY%\035 /VE /D "Adobe Photoshop CS" /f
REG ADD %KEY%\035 /V 1 /D "%CDROM%\Programvare\PhotoshopCS\Photoshop\setup.exe -S -f1 %CDROM%\Programvare\PhotoshopCS\Photoshop\setup.iss -f2 %SystemRoot%\Install\Photoshop.log" /f

REG ADD %KEY%\040 /VE /D "WinRAR 3.40" /f
REG ADD %KEY%\040 /V 1 /D "%CDROM%\Programvare\WinRAR\wrar340no.exe /s" /f

REG ADD %KEY%\045 /VE /D "Stomp RecordNow Max 4.5" /f
REG ADD %KEY%\045 /V 1 /D "%CDROM%\Programvare\RecordNow\Setup.exe /QB REBOOT=SUPRESS" /f

REG ADD %KEY%\050 /VE /D "Ahead Nero Burning Rom 6.3.125" /f
REG ADD %KEY%\050 /V 1 /D "%CDROM%\Programvare\Nero\nero63120.exe /silent=1 /silent /no_ui /setlang=NOR /nocancel /noreboot /sn=\"XXXX-XXXX-XXXX-XXXX-XXXX-XXXX\" /write_sn" /f
REG ADD %KEY%\050 /V 2 /D "%CDROM%\Programvare\Nero\nero63125.exe /silent=1 /silent /no_ui /setlang=NOR /nocancel /noreboot" /f

REG ADD %KEY%\055 /VE /D "K-Lite Mega Codec Pack 1.12" /f
REG ADD %KEY%\055 /V 1 /D "%CDROM%\Programvare\CodecPack\klmcodec112.exe /verysilent /loadinf=\"%CDROM%\Programvare\CodecPack\silent.inf\"" /f

REG ADD %KEY%\060 /VE /D "BSplayer Pro v1.02.812" /f
REG ADD %KEY%\060 /V 1 /D "%CDROM%\Programvare\BSplayer\bsplayerpro100.812.exe /S" /f

REG ADD %KEY%\065 /VE /D "DaemonTools 3.47" /f
REG ADD %KEY%\065 /V 1 /D "%CDROM%\Programvare\DaemonTools\daemon.msi /quiet /passive /qn /norestart REBOOT=ReallySuppress" /f

REG ADD %KEY%\070 /VE /D "Sprekker programvare" /f
REG ADD %KEY%\070 /V 1 /D "%CDROM%\Programvare\sprekk.cmd" /f

REG ADD %KEY%\075 /VE /D "Forbereder oppdatering av drivere" /f
REG ADD %KEY%\075 /V 1 /D "%CDROM%\$OEM$\RunOnceEx2.cmd" /f

REG ADD %KEY%\080 /VE /D "Sletter midlertidige filer" /f
REG ADD %KEY%\080 /V 1 /D "%CDROM%\$OEM$\opprydding.cmd" /f


EXIT

at 005 it installs drivers, i run a stand-alone cmd for this as follows...

at 080 it runs a batch that basicly just cleans up temp files, and deletes shortcuts etc, as well as reboot.

installer_drivere.cmd

cmdow @ /HID
@echo off

IF EXIST D:\WIN51 set CDROM=D:
IF EXIST E:\WIN51 set CDROM=E:
IF EXIST F:\WIN51 set CDROM=F:
IF EXIST G:\WIN51 set CDROM=G:
IF EXIST H:\WIN51 set CDROM=H:
IF EXIST I:\WIN51 set CDROM=I:
IF EXIST J:\WIN51 set CDROM=J:


start /wait %CDROM%\Drivere\000_agpchipset\Setup.exe -S -f1 %CDROM%\Drivere\000_agpchipset\setup.iss -f2 %SystemRoot%\Install\AGP.log

start /wait %CDROM%\Drivere\001_grafikk\Setup.exe -S -f1 %CDROM%\Drivere\001_grafikk\setup.iss -f2 %SystemRoot%\Install\nVidia.log

start /wait %CDROM%\Drivere\002_lyd\Setup.exe -S -f1 %CDROM%\Drivere\002_lyd\setup.iss -f2 %SystemRoot%\Install\Audigy.log

start /wait %CDROM%\Drivere\004_tv_kort\Setup\Setup.exe -S -f1 %CDROM%\Drivere\004_tv_kort\Setup\setup.iss -f2 %SystemRoot%\Install\PCTV.log


EXIT

RunOnceEx2.cmd

cmdow @ /HID
@echo off

IF EXIST D:\WIN51 set CDROM=D:
IF EXIST E:\WIN51 set CDROM=E:
IF EXIST F:\WIN51 set CDROM=F:
IF EXIST G:\WIN51 set CDROM=G:
IF EXIST H:\WIN51 set CDROM=H:
IF EXIST I:\WIN51 set CDROM=I:
IF EXIST J:\WIN51 set CDROM=J:

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

REG ADD %KEY% /V TITLE /D "Oppdaterer enhetsdrivere" /f

REG ADD %KEY%\005 /VE /D "Creative Audigy Platinum" /f
REG ADD %KEY%\005 /V 1 /D "%CDROM%\Drivere\003_lydoppdatering\Setup.exe -S -f1 %CDROM%\Drivere\003_lydoppdatering\setup.iss -f2 %SystemRoot%\AudigyUpdate.log" /f

REG ADD %KEY%\010 /VE /D "Starter paa nytt" /f
REG ADD %KEY%\010 /V 1 /D "%CDROM%\$OEM$\omstart.cmd" /f


EXIT

Did I get it right?

Link to comment
Share on other sites

@BoardBabe

Here's an example, of what you need to do:

cmdow @ /HID

@echo off

IF EXIST D:\WIN51 set CDROM=D:

IF EXIST E:\WIN51 set CDROM=E:

IF EXIST F:\WIN51 set CDROM=F:

IF EXIST G:\WIN51 set CDROM=G:

IF EXIST H:\WIN51 set CDROM=H:

IF EXIST I:\WIN51 set CDROM=I:

IF EXIST J:\WIN51 set CDROM=J:

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

REG ADD %KEY% /V TITLE /D "Installerer programvare" /f

REG ADD %KEY%\005 /VE /D "Enhetsdrivere" /f

REG ADD %KEY%\005 /V 1 /D "%CDROM%\$OEM$\installer_drivere.cmd" /f

REG ADD %KEY%\010 /VE /D "Microsoft .NET Framework v1.1 SP1" /f

REG ADD %KEY%\010 /V 1 /D "%systemdrive%\Drivers\NetFramework\netfx.msi /QB" /f

REG ADD %KEY%\010 /V 2 /D "%Systemdrive%\Drivers\NetFramework\NDP1.1sp1-KB867460-X86.exe /Q" /f

REG ADD %KEY%\015 /VE /D "MSN Messenger 6.2" /f

REG ADD %KEY%\015 /V 1 /D "%CDROM%\Programvare\MSN\MsnMsgs.msi /QB" /f

REG ADD %KEY%\080 /VE /D "Sletter midlertidige filer" /f

REG ADD %KEY%\080 /V 1 /D "%CDROM%\$OEM$\opprydding.cmd" /f

start /wait rundll32 iernonce.dll,RunOnceExProcess

REG ADD %KEY%\005 /VE /D "Your things to run after reboot" /f

REG ADD %KEY%\005 /V 1 /D "%CDROM%\$OEM$\whatever.cmd" /f

REG ADD %KEY%\010 /VE /D "Another line" /f

REG ADD %KEY%\010 /V 1 /D "%CDROM%\$OEM$\Another whatever.exe /S" /f

I hope that makes sense....

What does the above do?

It will run all the items, starting from 005 to 080, then make them run (that blue command does it), and then puts in a new set of RunOnceEx entries (which will be run at next reboot).

Link to comment
Share on other sites

This is going very wrong...

What happens now is at T12 it starts runOnceEx.cmd and installing of applications while the windows setup screen is still there. and it get alot of errors.

Here is my RunOnceEx.cmd

cmdow @ /HID
@echo off

IF EXIST D:\WIN51 set CDROM=D:
IF EXIST E:\WIN51 set CDROM=E:
IF EXIST F:\WIN51 set CDROM=F:
IF EXIST G:\WIN51 set CDROM=G:
IF EXIST H:\WIN51 set CDROM=H:
IF EXIST I:\WIN51 set CDROM=I:
IF EXIST J:\WIN51 set CDROM=J:

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

REG ADD %KEY% /V TITLE /D "Installerer programvare" /f

REG ADD %KEY%\005 /VE /D "Enhetsdrivere" /f
REG ADD %KEY%\005 /V 1 /D "%CDROM%\$OEM$\installer_drivere.cmd" /f

REG ADD %KEY%\010 /VE /D "Microsoft .NET Framework v1.1" /f
REG ADD %KEY%\010 /V 1 /D "%systemdrive%\Install\NetFramework\install.cmd" /f

REG ADD %KEY%\015 /VE /D "MSN Messenger 6.2" /f
REG ADD %KEY%\015 /V 1 /D "%CDROM%\Programvare\MSN\MsnMsgs.msi /QB" /f

REG ADD %KEY%\020 /VE /D "Microsoft Office 2003 Professional" /f
REG ADD %KEY%\020 /V 1 /D "%CDROM%\Programvare\Office2003\PRO11.msi /QB" /f

REG ADD %KEY%\025 /VE /D "Adobe Acrobat Reader 6" /f
REG ADD %KEY%\025 /V 1 /D "%CDROM%\Programvare\AdobeReader6\installer.cmd" /f

REG ADD %KEY%\030 /VE /D "Adobe Photoshop CS" /f
REG ADD %KEY%\030 /V 1 /D "%CDROM%\Programvare\PhotoshopCS\install.cmd" /f

REG ADD %KEY%\035 /VE /D "Adobe Illustrator CS" /f
REG ADD %KEY%\035 /V 1 /D "%CDROM%\Programvare\IllustratorCS\install.cmd" /f

REG ADD %KEY%\040 /VE /D "WinRAR 3.40" /f
REG ADD %KEY%\040 /V 1 /D "%CDROM%\Programvare\WinRAR\wrar340no.exe /s" /f

REG ADD %KEY%\045 /VE /D "Stomp RecordNow Max 4.5" /f
REG ADD %KEY%\045 /V 1 /D "%CDROM%\Programvare\RecordNow\Setup.exe /QB REBOOT=SUPRESS" /f

REG ADD %KEY%\050 /VE /D "Ahead Nero Burning Rom 6.3.125" /f
REG ADD %KEY%\050 /V 1 /D "%CDROM%\Programvare\Nero\nero63120.exe /silent=1 /silent /no_ui /setlang=NOR /nocancel /noreboot /sn=\"KEY\" /write_sn" /f
REG ADD %KEY%\050 /V 2 /D "%CDROM%\Programvare\Nero\nero63125.exe /silent=1 /silent /no_ui /setlang=NOR /nocancel /noreboot" /f

REG ADD %KEY%\055 /VE /D "K-Lite Mega Codec Pack 1.12" /f
REG ADD %KEY%\055 /V 1 /D "%CDROM%\Programvare\CodecPack\klmcodec112.exe /verysilent /loadinf=\"%CDROM%\Programvare\CodecPack\silent.inf\"" /f

REG ADD %KEY%\060 /VE /D "BSplayer Pro v1.02.812" /f
REG ADD %KEY%\060 /V 1 /D "%CDROM%\Programvare\BSplayer\bsplayerpro100.812.exe /S" /f

REG ADD %KEY%\065 /VE /D "DaemonTools 3.47" /f
REG ADD %KEY%\065 /V 1 /D "%CDROM%\Programvare\DaemonTools\daemon.msi /quiet /passive /qn /norestart REBOOT=ReallySuppress" /f

REG ADD %KEY%\070 /VE /D "Sprekker programvare" /f
REG ADD %KEY%\070 /V 1 /D "%CDROM%\Programvare\sprekk.cmd" /f

REG ADD %KEY%\075 /VE /D "cleanup and reboot" /f
REG ADD %KEY%\075 /V 1 /D "%CDROM%\$OEM$\cleanup.cmd" /f

start /wait rundll32 iernonce.dll,RunOnceExProcess

REG ADD %KEY%\005 /VE /D "update audigy" /f
REG ADD %KEY%\005 /V 1 /D "%SYSTEMDRIVE%\Drivers\003_lydoppdatering\Drivers\CTZAPXX.exe -S" /f

REG ADD %KEY%\010 /VE /D "cleanup install and driver dir" /f
REG ADD %KEY%\010 /V 1 /D "%CDROM%\$OEM$\opprydding2.cmd" /f

EXIT

Link to comment
Share on other sites

Well, that's what it is meant for - To make the runonce keys be processed right then and there.

Makes it simpler, isn't it?

You can make your runonceex.cmd run at first-logon, and directly import it to registry and "shake" it to make it execute also, right then and there.

It might look odd to you at first, but after learning it, you'll find that its actually easier.

Whatever registry keys you are adding AFTER the "rundll blah-blah" command will stay on in the registry, and get executed after a re-boot, just as you are used to.

Basically, you can use the command to run "phases" of your RunOnce-based install.

For example:

- import all your hotfixes keys, then get them executed using the command

- then import for apps, and then execute

- then import for fun/multimedia tools, execute

- then you can run the cleanup DIRECTLY from that CMD itself, instead of scheduling it to happen thru runonce method

- then import the next set of keys, which you want to run at next reboot (which is what you want at the end - a second time run of runonceEx; but while doing so, you're also making the process happen a bit cleaner).

Link to comment
Share on other sites

Ignore prathapml :P No offense. Seing as you're using CDROM install, ignore him. lol.

My question to you is...

well, I guess I'm trying to udnerstand to help you better.

You're install drivers form this right?

REG ADD %KEY%\005 /VE /D "Enhetsdrivere" /f
REG ADD %KEY%\005 /V 1 /D "%CDROM%\$OEM$\installer_drivere.cmd" /f

Do you want the system to restart prior to executing the Audigy Update? If so..

Then you had it right (the files you posted prior to prathapml suggestion. Did you test this?

Bascially, what I was saying is this...

1. At T-12 Setup runs CMDLINES.TXT which in turn Executes RunOnceEX.cmd. This Is where you were to start with.

2. System restarts, and the actual RunOnceEX window popups up and does it's thing.

Now, from here you want the system to restart and begin another RunOnceEX? ie RunOnceEX2.cmd?

If so....

Here is some basic understanding.

RunOnceEX deletes the keys (that's what you're importing in both CMD files) once they have been Executed. So, once Nero is done installing, and it moves to the next entry, the Nero information is No longer in the registry. This is important to note.

If you wanted ANOTHER RunOnceEX window to open up upon system restart after the first, you would have to run another CMD file with the keys, again RunOnceEX2.cmd. and add

REG ADD %KEY%\075 /VE /D "Forbereder oppdatering av drivere" /f
REG ADD %KEY%\075 /V 1 /D "%CDROM%\$OEM$\RunOnceEx2.cmd" /f

Just like you've done, so the new ones get imported. It's important to note this should be placed BEFORE your restart file (like you have done).

Now the "REG ADD %KEY%\075 " Should start over at 005, and work they're way back up.Which you have done.

Now when the system restarts, it should start another RunOnceEX window.

EDIT: Just saw prathapml a few minutes before I posted. Both methods have their strengths and weaknesses. Now to pick apart prathapml's. lol.

The problem if you follow that exactly....

your cleanup.cmd will execute and the rest of the keys will never be imported. SO as his suggestion goes, you should actually add the actual code in your cleanup.cmd to the RunOnceEX.cmd at the bottom. Now comes a problem, what happens if you're trying to execute the Audigy update that requires the drivers to already be installed. And everything, you need the restart, and prathapml's doesn't allow for that.

Link to comment
Share on other sites

Okey im starting to get it now. I think i just got to test a few ways to see what works the best for my setup. However now i get a strange error on T-12.

Test

File not found

And i have to click OK (its a dialogue).

I cant seem to find anything pointing to a test file at t-12.

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