Jump to content

CMDLINES.TXT and Win2k


Recommended Posts

I had multiple lines in cmdlines.txt because I copied to same file from my UAXP cd.

After a searching I saw win2k setup might not support multi-line cmdlines so I just put 'runonceex.cmd'

at t-13 stage, I see CMD window so runnonceex.cmd seems to be working, but none of the commands work after first logon.

Here's my runnonce .. Can anyone point me in a right direction? Thanks

cmdow @ /HID
@echo off

:RegKey
:1-10 - Drivers
:15-25 - System Related
:26-35 - nero adobe media

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:\CDROM_NT.5 SET CDROM=%%i:

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

REG ADD %KEY% /V TITLE /D "Installing Applications" /f

:REG ADD %KEY%\001 /VE /D "" /f
:REG ADD %KEY%\001 /V 1 /D "%systemdrive%\none1.bat" /f

:REG ADD %KEY%\002 /VE /D "" /f
:REG ADD %KEY%\002 /V 1 /D "REGEDIT /S %systemdrive%\regtv1.reg" /f

REG ADD %KEY%\003 /VE /D "" /f
REG ADD %KEY%\003 /V 1 /D "%systemdrive%\themes.cmd" /f

REG ADD %KEY%\004 /VE /D "" /f
REG ADD %KEY%\004 /V 1 /D "%CDROM%\wpi\wpi.hta" /f

REG ADD %KEY%\937 /VE /D "Finishing Installation 0 of 3" /f
REG ADD %KEY%\937 /V 1 /D "%SystemDrive%\DPsFnshr.exe" /f

REG ADD %KEY%\938 /VE /D "Finishing Installation 1 of 3" /f
REG ADD %KEY%\938 /V 1 /D "%systemdrive%\none1.bat" /f

REG ADD %KEY%\939 /VE /D "Finishing Installation 2 of 3" /f
REG ADD %KEY%\939 /V 1 /D "%CDROM%\winapp\cmd2.cmd" /f

REG ADD %KEY%\940 /VE /D "Finishing Installation 3 of 3" /f
REG ADD %KEY%\940 /V 1 /D "%CDROM%\winapp\finish.cmd" /f


:REG ADD %KEY%\0 /VE /D "" /f
:REG ADD %KEY%\0 /V 1 /D "%CDROM%\winapp\" /f

EXIT

Edited by larciel
Link to comment
Share on other sites


AFAIK, W2K does not execute the RunOnceEx key at startup so you may need to invoke the action from the RunOnce key.

Add the below commands to the end of your RunOnceEx.cmd and test it.

SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce
REG ADD %KEY% /V "_RunOnceEx" /D "rundll32.exe iernonce.dll,RunOnceExProcess" /f

:)

Link to comment
Share on other sites

AFAIK, W2K does not execute the RunOnceEx key at startup so you may need to invoke the action from the RunOnce key.

Add the below commands to the end of your RunOnceEx.cmd and test it.

SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce
REG ADD %KEY% /V "_RunOnceEx" /D "rundll32.exe iernonce.dll,RunOnceExProcess" /f

:)

It's mind boggling, well at least very inconvenient doing win2k install after years of xp install.. I still like small footprint and snapiness of win2k over xp but this problem along with unable to do quick format in setup might deter me from setting up my home pc back to win2k as I do alot of reinstall.

I'll test it today. I hope it works :)

Link to comment
Share on other sites

The lines preceded by colons, (:), are not doing what you were hoping for either. Lines preceded by two colons, (::), are considered as comments and not read, those with just one are still picked up.

Link to comment
Share on other sites

Sorry, i don't know the answer to your problem, but atleast i can tell you that 'RunOnceEx' + multi-line 'cmdlines.txt' entries does work on Win2K also...

Looks like I have been corrected. Thanks for informing.

@larciel

I amended your script with changes suggest by Yzöwl. You can also use goto a label to jump over lots of comments so the interpreter quickly skips them and is good for header comments at the top of your script.


cmdow @ /HID
@echo off
goto :main
:: RegKey
:: 1-10 - Drivers
:: 15-25 - System Related
:: 26-35 - nero adobe media

:main
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:\CDROM_NT.5 SET CDROM=%%i:
)

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

REG ADD %KEY% /V TITLE /D "Installing Applications" /f

:: REG ADD %KEY%\001 /VE /D "" /f
:: REG ADD %KEY%\001 /V 1 /D "%systemdrive%\none1.bat" /f

:: REG ADD %KEY%\002 /VE /D "" /f
:: REG ADD %KEY%\002 /V 1 /D "REGEDIT /S %systemdrive%\regtv1.reg" /f

REG ADD %KEY%\003 /VE /D "" /f
REG ADD %KEY%\003 /V 1 /D "%systemdrive%\themes.cmd" /f

REG ADD %KEY%\004 /VE /D "" /f
REG ADD %KEY%\004 /V 1 /D "%CDROM%\wpi\wpi.hta" /f

REG ADD %KEY%\937 /VE /D "Finishing Installation 0 of 3" /f
REG ADD %KEY%\937 /V 1 /D "%SystemDrive%\DPsFnshr.exe" /f

REG ADD %KEY%\938 /VE /D "Finishing Installation 1 of 3" /f
REG ADD %KEY%\938 /V 1 /D "%systemdrive%\none1.bat" /f

REG ADD %KEY%\939 /VE /D "Finishing Installation 2 of 3" /f
REG ADD %KEY%\939 /V 1 /D "%CDROM%\winapp\cmd2.cmd" /f

REG ADD %KEY%\940 /VE /D "Finishing Installation 3 of 3" /f
REG ADD %KEY%\940 /V 1 /D "%CDROM%\winapp\finish.cmd" /f

:: REG ADD %KEY%\0 /VE /D "" /f
:: REG ADD %KEY%\0 /V 1 /D "%CDROM%\winapp\" /f

EXIT

I tested adding into my registry within XP (looked good viewed in regedit) and then running iernonce.dll manually to invoke RunOnceEx and it performs as well as expected. So there maybe something else causing the issue. Perhaps a good idea to check the Cmdlines.txt file (ensure the name is correct and entries within are correct).

Link to comment
Share on other sites

I have no idea why it doesn't work

here's my cmdline.txt (edited to multi line)

[COMMANDS]
"ROE.exe 937"
"REGEDIT /S regtv1.reg"
"runonceex.cmd"
"themes.cmd"

ROE.exe is BTS's driverpacks finisher. and it's the only thing that runs in first logon

@mhz, tried your edit but it still doesn't go ..

cmdow @ /HID
@echo off

::RegKey
::1-10 - Drivers
::15-25 - System Related
::26-35 - nero adobe media

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:\CDROM_NT.5 SET CDROM=%%i:

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

REG ADD %KEY% /V TITLE /D "Installing Applications" /f

::REG ADD %KEY%\001 /VE /D "" /f
::REG ADD %KEY%\001 /V 1 /D "%systemdrive%\none1.bat" /f

::REG ADD %KEY%\002 /VE /D "" /f
::REG ADD %KEY%\002 /V 1 /D "REGEDIT /S %systemdrive%\regtv1.reg" /f

REG ADD %KEY%\004 /VE /D "" /f
REG ADD %KEY%\004 /V 1 /D "%CDROM%\wpi\wpi.hta" /f

REG ADD %KEY%\938 /VE /D "Finishing Installation 1 of 3" /f
REG ADD %KEY%\938 /V 1 /D "%systemdrive%\none1.bat" /f

REG ADD %KEY%\939 /VE /D "Finishing Installation 2 of 3" /f
REG ADD %KEY%\939 /V 1 /D "%CDROM%\winapp\cmd2.cmd" /f

REG ADD %KEY%\940 /VE /D "Finishing Installation 3 of 3" /f
REG ADD %KEY%\940 /V 1 /D "%CDROM%\winapp\finish.cmd" /f

SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce
REG ADD %KEY% /V "_RunOnceEx" /D "rundll32.exe iernonce.dll,RunOnceExProcess" /f

::REG ADD %KEY%\0 /VE /D "" /f
::REG ADD %KEY%\0 /V 1 /D "%CDROM%\winapp\" /f

EXIT

Edited by larciel
Link to comment
Share on other sites

here's my cmdline.txt (edited to multi line)

cmdlineS.txt

Perhaps just a typo mistake as you got the filename correct in the topic title but failed in your previous post. But that is all it takes for something to go wrong if you named it cmdline.txt which setup may not recognize. The entries seem fine. You can remove the "rundll32.exe iernonce.dll,RunOnceExProcess" entry from runonceex.cmd as that seems not the issue.

ROE.exe is BTS's driverpacks finisher. and it's the only thing that runs in first logon

Well, that is the 1st entry of cmdlines.txt and you state it works. Strange... try changing the entry order.

[COMMANDS]
"runonceex.cmd"
"themes.cmd"
"REGEDIT /S regtv1.reg"
"ROE.exe 937"

If you need to for debugging, try to add an entry of "REGEDIT" in cmdlines.txt and check the RunOnceEx key to ensure the entries were added at T-12.

Link to comment
Share on other sites

After several reinstall, I know one thing, only the 'runonceex.cmd is skipped.

After windows install. I manually ran runonceex.cmd and watched the Registry location. The parameters do not appear.

I don't see anything wrong with runonce code.. Any guess?

Link to comment
Share on other sites

Perhaps you do not have Reg.exe on Windows 2000? I looked at Windows 2000 source files and I cannot see Reg.exe in a cab file. I looked at a website here and quote the vital information below.

The Microsoft ® Windows NT ® Server 4.0 Resource Kit contains, among many others, REG.EXE.

In Windows 2000 REG.EXE is available on the Windows installation CD-ROM, but has to be installed manually (on the CD-ROM run "\SUPPORT\TOOLS\SETUP.EXE").

As of Windows XP, REG.EXE is a native command.

I see it within the "\SUPPORT\TOOLS\SUPPORT.CAB" that SETUP.EXE with the same folder probably extracts. I feel sorry for all the testing that you have done only to find out Reg.exe is perhaps missing for use. :blink: You maybe able to copy needed files into "$OEM$\$$\System32" using the OEMPreinstall option in Winnt.sif.

Link to comment
Share on other sites

well. I don't know how everyone else did their runonceex.cmd w/out the reg.exe. You hit it right on the head; I put reg.exe file to system32 folder and it works now! Thank you very much

Thanks again!

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