Jump to content

Using both RunOnceEx & nLite


ccc

Recommended Posts

I wanted to import HKCU & HKLM via "RunOnceEx.cmd" in (cmdlines.txt) and to follow that with those changes that nLite makes:

[Commands]

"RunOnceEx.cmd"

"rundll32 advpack.dll,LaunchINFSection nLite.inf,nLiteReg"

Since RunOnce & RunOnceEx run at the same time, there will be interference between them.

Especially since I’m importing my whole HKCU key (admin to admin) and my whole HKCU/Software key.

Is there a way to control the sequence of events?

Is there a way to get nLite to use RunOnceEx or to convert nLite’s nLite.inf RunOnce entries to RunOnceEx?

Thanks

Link to comment
Share on other sites


OK, I tried this and it seems to work.

If anyone knows a better way, please feel free to suggest.

Removed the line

“rundll32 advpack.dll,LaunchINFSection nLite.inf,nLiteReg”

from cmdlines.txt and then

as the last entry in RunOnceEx.cmd have a bat file (nLiteinf.bat) that then runs

“rundll32 advpack.dll,LaunchINFSection nLite.inf,nLiteReg”

Does this strategy allow nLite to do all it needs to do?

Or is there be a better way?

---------

File Examples:

---------

cmdlines.txt would be:

[Commands]

"RunOnceEx.cmd"

---------

RunOnceEx.cmd would be:

@echo off

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

REG ADD %KEY% /V TITLE /D "Replacements & Imports" /f

REG ADD %KEY%\003 /VE /D "Replacing Notepad & MAKECAB" /f

REG ADD %KEY%\003 /V 1 /D "E:\UA01\$OEM$\Notepad.bat" /f

REG ADD %KEY%\020 /VE /D "Deleting & Importing HKLM-TWEAKS.REG" /f

REG ADD %KEY%\020 /V 1 /D "REGEDIT /S E:\UA01\$OEM$\HKLM-TWEAKS.REG" /f

REG ADD %KEY%\099 /VE /D "Doing nLite.inf" /f

REG ADD %KEY%\099 /V 1 /D "E:\UA01\$OEM$\nLiteinf.bat" /f

(SEE Post #6 below)

shutdown -r -f -t 30 -c "Rebooting In 30 Seconds"

---------

“nLiteinf.bat" would be:

@echo off

rundll32 advpack.dll,LaunchINFSection nLite.inf,nLiteReg

Edited by ccc
Link to comment
Share on other sites

Thanks chapmani,

But the nLite.inf runonce entries I’m talking about are those in I386/nLite.in_ which becomes C:\windows\inf\nLite.inf. And as far as I can tell, these entries are a part of nLite's activity regardless of “the stuff you put in the RunOnceGUI section of nLite”.

I thought a separate reboot would help, but that wasn’t possible with the last entry I was trying to place in RunOnceEx – those must be run and then cleared; rather than dumped to memory. Anyway, went back to running "rundll32 advpack.dll,LaunchINFSection nLite.inf,nLiteReg" from the last RunOnceEx (as reflected in edit to second post above), but still getting conflicts.

I now think the conflicts I’m getting are with what I’m trying to import via my reg files.

Edited by ccc
Link to comment
Share on other sites

Actually, one can just enter the inf command directly into RunOnceEx instead of the bat / cmd file that runs it.

So you would have:

REG ADD %KEY%\099 /VE /D "Doing nLite.inf" /f

REG ADD %KEY%\099 /V 1 /D "rundll32 advpack.dll,LaunchINFSection nLite.inf,nLiteReg" /f

Instead of:

REG ADD %KEY%\099 /VE /D "Doing nLite.inf" /f

REG ADD %KEY%\099 /V 1 /D "E:\UA01\$OEM$\nLiteinf.bat" /f

and thus with no nLiteinf.bat file needed.

Link to comment
Share on other sites

I have experenced many issues with importing reg entries late in the game (once your logged in). Now I have a multi teared reg entry procedure that works great. First reg entry which is universal to pc is at cmdlines. If you do an entry then it will almost always work unless its corrupt. Second is right after first logon but I kill explorer & runonce runs then and third is once finally logged in. Try that and it should make it all work.

Link to comment
Share on other sites

Thanks Madhits45,

>>> First reg entry which is universal to PC

I’m guessing that one is very generic with no software settings?

>>> Second is right after first logon but I kill explorer & runonce runs then

Could you give examples of these commands?

And if you use nLite, how do you deal with the nLite.inf command?

Thanks

Edited by ccc
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...