Jump to content

RunonceEx


 Share

Recommended Posts

Okay so I am trying to figure out how to run a *.cmd file from the CD. My problem is that I need to make two types of CDs, once for unattended installs and the other for XP repairs. I finally got the XP repair one to actually work, but now I can't figure out how to get it to run a CMD file from the CD. Or better yet figure out a way to copy it to the computer and then run it without having to use the OEM Pre-install switch in the winnt.sif file.

Anyway I am trying to apply two .reg entries, one local and one user. The user one is most important to apply during the install as it sets defaults for all subsequent user accounts. I also want to set it up to run the DPsFnshr.exe file because for some reason that file isn't running.

When I have the cmdlines.txt file in the OEM folder does that one still run even if the unattended part of the sif file is not there?

Any help would be awesome!

Link to comment
Share on other sites


Hi xenon2050,

I run my RunOnceEx.cmd from cd. I've put the command in the directory \Install\Other on CD. In my cmdlines.txt I have the following line

"\Install\Other\RunOnceEx.cmd"

to execute the RunOnceEx.cmd.

If you put your RunOnceEx.cmd in the $OEM$ directory, I think

"RunOnceEx.cmd"

should be sufficient. Otherwise

"\$OEM$\RunOnceEx.cmd"

On your other question about "OEM Pre-install switch in the winnt.sif". I'm not sure, but I thought it should be there to execute cmdlines.txt.

Link to comment
Share on other sites

Thanks for the reply. I tried that out, but it is not finding the file. For some reason it is not executing from that location. This is what I got:

[Commands]
"ROE.exe 937"
"REGEDIT /S HKEYUSER.reg"
"install.cmd"

But when windows starts up after installing it says that it can't find "%CDROM%\install.cmd" or something to that effect. I use a winnt.sif file but I don't have any [unattended] section because that breaks the repair function.

I tried sifting through the numerous %CDROM% variable posts but I can't seem to figure out how to get it to work.

Edited by xenon2050
Link to comment
Share on other sites

cmdlines.txt is parsed even though 'OemPreinstall' in winnt.sif is set to 'No'(or un-defined) and no path needs to be given if the batch/reg-files is in the $OEM$ folder.

Environment-variables isn't supported from cmdlines.txt, but direct-paths can be avoided with '..\[...]', and where '..\' references the root of the CD(i.e. one level up from $OEM$(like jjvs also mentioned).

Another possibility is to place your batch/reg-files in '\I386\svcpack\' and run them from svcpack.inf's 'SetupHotfixesToRun' section(located in '\I386\').

Edit: Just wanted to mention that the OP posted a new post, while i was writing mine...

Edited by Martin H
Link to comment
Share on other sites

Okay so I did figure something out...

What I ended up doing is since I am using Driverpack they make a presetup.cmd file and I just added a couple of entries in there to copy my install.cmd and two reg files to the hard drive then I was able to actually point the cmdlines.txt to the c:\ (I always use c: so that shouldn't pose a problem) I tried using %systemdrive% in the cmdlines.txt but it never worked... I tried this...

[Commands]
"REGEDIT /S %systemdrive%\HKEYUSER.reg"

But it didn't work so I just ended up replacing %systemdrive% with c:\

Anywho thanks for your help and if you have any solution to the %systemdrive% that would be great because I would like to run it from that variable in the off chance that it isn't c:

Edited by xenon2050
Link to comment
Share on other sites

Make a folder named 'setup' in the root and place everything you wan't installed into it.

Download hidcon.exe and place it in 'setup'(2kb tool to hide the command-prompt).

Make a batchfile in 'setup' named 'setup.cmd' :

setlocal enableextensions
set setup=%~d0\setup
[...]
endlocal

Exchange '[...]' with whatever you wan't installed, like e.g. :

regedit /s %setup%\hkey_user.reg
start /wait %setup%\Some_Switchless_Installer.exe

Add this line to '\$OEM$\cmdlines.txt' :

[Commands]
"..\setup\hidcon.exe ..\setup\setup.cmd"

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.


×
×
  • Create New...