Page 1 of 1
Problems with getting RunOnce to work I'm apparently doing something wrong, I just don't know what.
#1
Posted 22 September 2008 - 08:41 AM
Although I may want to do more later, at the moment all I want to be able to do with the RunOnce feature is create some empty folders with specific names, merge in some .reg files, & run a couple of installers, but so far the only thing I can get to work is the empty folder creation.
The empty folder creation is done from a batch file with the command line:
%source%\batch\makefolders.bat
No problems there, but everything else I've tried to get the rest working fails.
I've tried both:
regedit /s "%source%\regfiles\filename.reg"
"regedit /s %source%\regfiles\filename.reg"
as indivual lines in the RunOnce tab in nLite, as well as putting them in a batch file. I've also tried using %%source%%, as apprently batch files need a double % instead of a single 1.
I tried using an xcopy command to copy the regfiles folder to the drive & then run them from there, which didn't work either [wouldn't even do the xcopy]. I've even tried using the OEM folder method to copy the files over, which worked, & then merge the reg files from there, which didn't work.
Anyone got any ideas?
The empty folder creation is done from a batch file with the command line:
%source%\batch\makefolders.bat
No problems there, but everything else I've tried to get the rest working fails.
I've tried both:
regedit /s "%source%\regfiles\filename.reg"
"regedit /s %source%\regfiles\filename.reg"
as indivual lines in the RunOnce tab in nLite, as well as putting them in a batch file. I've also tried using %%source%%, as apprently batch files need a double % instead of a single 1.
I tried using an xcopy command to copy the regfiles folder to the drive & then run them from there, which didn't work either [wouldn't even do the xcopy]. I've even tried using the OEM folder method to copy the files over, which worked, & then merge the reg files from there, which didn't work.
Anyone got any ideas?
#2
Posted 22 September 2008 - 09:14 AM
Alien42,
I know this is not a direct answer to your question but I suggest you look into WPI (Windows Post Install). It will do all the things you want and is much easier to use. See a couple forums below the nLite forum.
Enjoy, John.
I know this is not a direct answer to your question but I suggest you look into WPI (Windows Post Install). It will do all the things you want and is much easier to use. See a couple forums below the nLite forum.
Enjoy, John.
#3
Posted 22 September 2008 - 09:26 AM
I thought WPI was more of an app that ran after install & acted kinda like the install menu on some CDs, except it lets you select a whole bunch to install, rather than 1 at a time?
#4
Posted 22 September 2008 - 10:25 AM
Well, I just tried the svcpack.inf method, & even that didn't work! WTF?!
I put the reg files in the svcpack folder, then added the necessary lines to svcpack.inf, e.g:
regedit.exe /s "Notepad.reg"
regedit.exe /s "UpdatesDisableNotify.reg"
regedit.exe /s "AntiVirusDisableNotify.reg"
regedit.exe /s "Single Click Underline Icons.reg"
& still no luck.
I put the reg files in the svcpack folder, then added the necessary lines to svcpack.inf, e.g:
regedit.exe /s "Notepad.reg"
regedit.exe /s "UpdatesDisableNotify.reg"
regedit.exe /s "AntiVirusDisableNotify.reg"
regedit.exe /s "Single Click Underline Icons.reg"
& still no luck.
#5
Posted 22 September 2008 - 12:26 PM
Alien42, on Sep 22 2008, 04:41 PM, said:
Although I may want to do more later, at the moment all I want to be able to do with the RunOnce feature is create some empty folders with specific names, merge in some .reg files, & run a couple of installers, but so far the only thing I can get to work is the empty folder creation.
The empty folder creation is done from a batch file with the command line:
%source%\batch\makefolders.bat
No problems there, but everything else I've tried to get the rest working fails.
I've tried both:
regedit /s "%source%\regfiles\filename.reg"
"regedit /s %source%\regfiles\filename.reg"
as indivual lines in the RunOnce tab in nLite, as well as putting them in a batch file. I've also tried using %%source%%, as apprently batch files need a double % instead of a single 1.
I tried using an xcopy command to copy the regfiles folder to the drive & then run them from there, which didn't work either [wouldn't even do the xcopy]. I've even tried using the OEM folder method to copy the files over, which worked, & then merge the reg files from there, which didn't work.
Anyone got any ideas?
The empty folder creation is done from a batch file with the command line:
%source%\batch\makefolders.bat
No problems there, but everything else I've tried to get the rest working fails.
I've tried both:
regedit /s "%source%\regfiles\filename.reg"
"regedit /s %source%\regfiles\filename.reg"
as indivual lines in the RunOnce tab in nLite, as well as putting them in a batch file. I've also tried using %%source%%, as apprently batch files need a double % instead of a single 1.
I tried using an xcopy command to copy the regfiles folder to the drive & then run them from there, which didn't work either [wouldn't even do the xcopy]. I've even tried using the OEM folder method to copy the files over, which worked, & then merge the reg files from there, which didn't work.
Anyone got any ideas?
The "\" after %source% is not needed, in fact %source% already contain one
#6
Posted 22 September 2008 - 12:33 PM
mooms, on Sep 22 2008, 07:26 PM, said:
The "\" after %source% is not needed, in fact %source% already contain one
It shouldn't make any difference, Windows just ignores any extra back-slashes in the path. I tested that theory both in a command prompt window & a batch file. Even 3 slashes will work as if there were just 1. Besides, if that were the cause then the batch file for creating the empty folders wouldn't work, but it does work
#7
Posted 26 September 2008 - 01:20 PM
I've been having the same problem. Used a batch file to replace some files and then import some regs.
This batch file works flawless if I manually run it after windows has fully booted.
But during RunOnce, the batch file runs with nothing but errors.
I'm using the v4 format (first line REGEDIT4) for my reg files, but name them as text files for easier editing.
With lines in batch file like: REG IMPORT rSwapOnD300.txt
I also tried running from CD and from HDD with same result.
This batch file works flawless if I manually run it after windows has fully booted.
But during RunOnce, the batch file runs with nothing but errors.
I'm using the v4 format (first line REGEDIT4) for my reg files, but name them as text files for easier editing.
With lines in batch file like: REG IMPORT rSwapOnD300.txt
I also tried running from CD and from HDD with same result.
#8
Posted 27 September 2008 - 10:57 AM
RUSerious, on Sep 26 2008, 08:20 PM, said:
I've been having the same problem. Used a batch file to replace some files and then import some regs.
This batch file works flawless if I manually run it after windows has fully booted.
But during RunOnce, the batch file runs with nothing but errors.
I'm using the v4 format (first line REGEDIT4) for my reg files, but name them as text files for easier editing.
With lines in batch file like: REG IMPORT rSwapOnD300.txt
I also tried running from CD and from HDD with same result.
This batch file works flawless if I manually run it after windows has fully booted.
But during RunOnce, the batch file runs with nothing but errors.
I'm using the v4 format (first line REGEDIT4) for my reg files, but name them as text files for easier editing.
With lines in batch file like: REG IMPORT rSwapOnD300.txt
I also tried running from CD and from HDD with same result.
I've made some progress with this. As I said before, I have a batch file which creates some empty folders, which is set up from nLite's RunOnce section, with the command:
%source%\batch\makefolders.bat
As this was the only thing that worked, I decided to try adding some of the extra stuff I wanted done to the end of that file, & it worked!
For my reg tweaks, I copy them over by putting them in a folder like
S:\XP_Source\$OEM$\$1\Regfiles
and then add a line like
start /w regedit /s "%SystemDrive%\Regfiles\mytweaks.reg"to my batch file.
I'm not sure, but I think the reason the %source% variable works for running the first batch file, & not for anything inside that batch file, is because of the way Nuhi's implemented the whole RunOnce & %source% thing. I haven't gotten around to trying it yet [can't be bothered
FOR %%i IN (D E F G H I J K L M N O P Q R S T U V W X Y Z) DO IF EXIST %%i:\WIN51AP.SP2 SET CDROM=%%i:
To make it work you just have to get it to look for a specific file in the root of the CD drive. In my case I've told it to look for WIN51AP.SP2, but if you're using a different version of XP, or don't have that file for whatever reason, you can just create an empty file like "cdrom.txt" or whatever & have the command look for that instead.
I've tested it with stuff like VirtualBox's VBoxAdditions, Windows Update Agent, & .Net 2.0 SP1 x64 [a 7-zip silent installer version I made].
[side note: for some reason I've found that none of the three progs I mentioned above will work if I put start /w before them. I think this has got something to do with the variable only being valid per instance of command line or whatever, so a possible work around might be to use start /w somebatchfile.bat to call another batch file, & then make sure to add the drive letter setting command into that batch file before the line that calls the specific prog. Again, this is an untested theory.
Just for good measure I have put the drive-finding command before each of those, as I got so frustrated with things not working that I couldn't be bothered with any more "trial & error" if I could avoid it, but it might work with just 1 instance of that command per batch file; I just can't be bothered to put that to the test at the moment.
<edit>
P.S.: I don't know if it makes any difference, but XP .reg files usually say version 5, not 4.
</edit>
This post has been edited by Alien42: 27 September 2008 - 11:00 AM
Share this topic:
Page 1 of 1



Help
Back to top









