Jump to content

Cmdlines.txt custom cmd file not running


Recommended Posts

Hi, I am setting up an unattended Windows 2003 server CD for my organization. One of the things I wanted to automate during the install (without having to login) was copying the i386 directory to the C:\. I found some great scripts for this on the forums and modified one that I liked.

Here is my script (i386.cmd) which I slightly modified from one on these forums (thanks Sonic):

@ECHO OFF
TITLE Copying i386 folder to hard drive ...
FOR /f "skip=4 tokens=3" %%p IN ('REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v SourcePath') DO SET CDSource=%%p
XCOPY /s /c /i /f /k /y /EXCLUDE:exclude.txt "%CDSource%" "%SystemDrive%\i386\"
TITLE Adding source path registry entries ...
REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "SourcePath" /d "%SystemDrive%\i386" /f
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup" /v "Installation Sources" /t REG_MULTI_SZ /d "%SystemDrive%" /f
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup" /v "SourcePath" /d "%SystemDrive%" /f
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup" /v "ServicePackSourcePath" /d "%SystemDrive%" /f
REG ADD "HKLM\SOFTWARE\Microsoft\Transaction Server\Setup(OCM)" /v "Source Path" /d "%SystemDrive%" /f
REG ADD "HKLM\SOFTWARE\Microsoft\MSDTC\Setup" /v "Source Path" /d "%SystemDrive%" /f
REG ADD "HKLM\SOFTWARE\Microsoft\COM3\Setup" /v "Source Path" /d "%SystemDrive%" /f
EXIT

I created 'cmdlines.txt' and put it in $OEM$ on the CD. This is also where my i386.cmd file lives. However nothing gets copied over (not sure if it is attempting to run or not). When I test i386.cmd by itself after it does the regular unattended install it runs as expected and copies the i386 directory.

What are some things I can try? Is it possible that HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SourcePath is not yet available so it can't find the CDROM drive?

Link to comment
Share on other sites


I would go with the key not being setup yet. Easy way to tell would be to echo back your results and put a pause statement in to test.

Or when the install is running press shift+f10 which will open a cmd window and you can run the commands manually and see what fails.

Or you could use another method to detect the cd drive letter.

Link to comment
Share on other sites

Make sure your $OEM$ folder is in the right place. When you install from hard drive it needs to be under the i386 folder, when you install from cd it needs to be parallel to i386 folder. When in doubt - copy $oem$ to both locations.

-gosh

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