Jump to content

Cmdlines.txt Not Working


Recommended Posts

I would like to use the RunOnceEx method to install applications. However, it seems like the cmdlines.txt is not processed or the runonce.cmd file is not properly configured. I have made sure the cmdlines.txt and runonce.cmd files are in the $OEM$ on the root of the installationation CD and made the OEMPreinstall=Yes in the winnt.sif file. I do not know how come it is not working.

Here is my cmdlines.txt file:

[COMMANDS]
"runonce.cmd"

Here is my runonce.cmd file:

cmdow @ /HID
@echo off

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

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

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

REG ADD %KEY%\005 /VE /D "Adobe Reader 7" /f
REG ADD %KEY%\005 /V 1 /D "%CDROM%\install\ar7\ar7.msi /qn" /f

EXIT

Here is my winnt.sif file:

;SetupMgrTag
[Data]
   AutoPartition=1
   MsDosInitiated="0"
   UnattendedInstall="Yes"

[Unattended]
   UnattendMode=FullUnattended
   OemSkipEula=Yes
   OemPreinstall=Yes
   TargetPath=\WINNT
   Repartition=Yes
   WaitForReboot=No

[GuiUnattended]
   AdminPassword=test
   AutoLogon=Yes
   AutoLogonCount=1
   OEMSkipRegional=1
   TimeZone=10
   OemSkipWelcome=1

[UserData]
   FullName="Installed for"
   OrgName="Someone"
   ComputerName=*

[TapiLocation]
   CountryCode=107
   AreaCode=780

[Branding]
   BrandIEUsingUnattended=Yes

[URL]
   Home_Page=http://www.msn.ca

[Proxy]
   Proxy_Enable=0
   Use_Same_Proxy=1

[Identification]
   JoinWorkgroup=workgroup

[Networking]
   InstallDefaultComponents=Yes

[GuiRunOnce]

Link to comment
Share on other sites


Have you got a file called CD.txt in the root of your CD too?

If not either change

DO IF EXIST %%i:\CD.txt SET CDROM=%%i:

in you runonce.cmd

to

DO IF EXIST %%i:\WIN51 SET CDROM=%%i:

where

WIN51 is the name of any file in the root of your CD

or

create a file called CD.txt and put it in the root of your CD

Link to comment
Share on other sites

I put a test batch file in my cmdlines.txt as follows just to see if the cmdlines.txt was getting parsed or not:

[COMMANDS]
"test.bat"
"runonce.cmd"

Here is the test.bat file:

md %systemdrive%\test

Sure enough the test folder is being made so the problem must be with something in the runonce.cmd file. I made sure I had the cd.txt on the root of of the CD to make sure the CD-ROM variable works within the runonce.cmd file:

cmdow @ /HID
@echo off

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:\cd.txt 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 "Adobe Reader 7" /f
REG ADD %KEY%\001 /V 1 /D "%CDROM%\install\ar7\ar7.msi /qn" /f


EXIT

I don't know why it is still not working.

Link to comment
Share on other sites

Cant see anything wrong with your files. If you have CMDOW.EXE and AR7.MSI in the correct folders on your CD then it should work.

For testing, try changing your runonce.cmd to this, then check C:\test.txt for errors.

REM cmdow @ /HID
@echo off

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:\cd.txt 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 "Adobe Reader 7" /f
REG ADD %KEY%\001 /V 1 /D "%CDROM%\install\ar7\ar7.msi /qn" /f

echo %CDROM%\install\ar7\ar7.msi  > %systemdrive%\test.txt
dir %CDROM%\install\ar7 >>%systemdrive%\test.txt
dir %systemroot%\system32\cmdow.exe >>%systemdrive%\test.txt

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