April 14, 200422 yr I don't think this has been mentioned yet, but for those who have trouble adding PATA/SATA/RAID controller drivers to your CD you can use this method to manually install the drivers with a floppy and still get the $OEM$ folders copied over.As some people may be aware, having OemPreinstall=yes will break F6 to install drivers, whereas OemPreinstall=No doesn't.Cmdlines.txt - This is executed no matter whether OemPreinstall is enabled or not, so we're going to launch a .cmd file from cmdlines.txt.Open up notepad and paste the following:@echo off IF EXIST D:\$OEM$ set CDROM=D:IF EXIST E:\$OEM$ set CDROM=E:IF EXIST F:\$OEM$ set CDROM=F:IF EXIST G:\$OEM$ set CDROM=G:IF EXIST H:\$OEM$ set CDROM=H:IF EXIST I:\$OEM$ set CDROM=I:IF EXIST J:\$OEM$ set CDROM=J: XCOPY /E /Q %CDROM%\$OEM$\$1 %SYSTEMDRIVE%XCOPY /E /Q %CDROM%\$OEM$\$$ %SYSTEMROOT%XCOPY /E /Q %CDROM%\$OEM$\$Docs "%SYSTEMDRIVE%\Documents and Settings"XCOPY /E /Q %CDROM%\$OEM$\$Progs "%PROGRAMFILES%" EXITSave this as OemPreinstall.cmd in the \$OEM$\ folder.Add to (or make) a cmdlines.txt file:[COMMANDS]"OemPreinstall.cmd"And save in the \$OEM$\ folder.There is a disadvantage to this method - you cannot use OemPnpDriversPath= to install your drivers as the folders are copied over far too late for Setup to detect and install them.
April 15, 200422 yr Confused I am.If OemPreinstall=No then the $OEM$ folder is ignored (yes?).So how can Cmdlines.txt in the \$OEM$\ folder always run?Sorry if that's stupid question.
April 15, 200422 yr Author When its set as No it won't copy over. But launching the .cmd file from cmdlines.txt looks for the $OEM$ folder on the CD, no matter what driver letter it has, then copies over everything in it to the hard disk (just as OemPreinstall=yes would do)
April 15, 200422 yr the folder isn't ignored, just not copied.If cmdlines.txt is in there, then it will run. Just like svcpack.inf. If there is something in there,they will run.Good thing I don't copy anything over
April 15, 200422 yr Ah I see. That's good.I wanna run some reg tweaks but still need the F6 option.Thanks.
April 15, 200422 yr I switched my brain on and got it sorted.I'm just using 2 files : cmdlines.txt and XPtweak.regcmdlines.txt has:[COMMANDS]"REGEDIT /S XPtweak.reg"and this works! No need for the .CMD (in my case anyway).Thanks for all the quick and helpful replies!
April 5, 200620 yr Anyone else re-finding this old thread may be interested in this more robust example for the batch file.OemPreinstall.cmd@CMDOW.EXE @ /HID 2>NUL||@ECHO OFFSETLOCAL ENABLEEXTENSIONSFOR %%? IN (C 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 /I "%%?:" NEQ "%SYSTEMDRIVE%" CALL :SUB "%%?:" &&GOTO START)GOTO ENDIT:STARTIF EXIST %MYOEM%\$1 XCOPY %MYOEM%\$1 %SYSTEMDRIVE% /S/I/Q/Y >NULIF EXIST %MYOEM%\$$ XCOPY %MYOEM%\$$ %SYSTEMROOT% /S/I/Q/Y >NULIF EXIST %MYOEM%\$Docs XCOPY %MYOEM%\$Docs "%ALLUSERSPROFILE%\.." /S/I/Q/Y >NULIF EXIST %MYOEM%\$Progs XCOPY %MYOEM%\$Progs %PROGRAMFILES% /S/I/Q/Y >NUL:ENDITENDLOCAL &GOTO :EOF:SUBIF NOT EXIST %~1\$OEM$ EXIT/B 1SET "MYOEM=%~1\$OEM$"EXIT/B 0It should be okay run as is without alteration.
April 5, 200620 yr I don't know how I missed this thread when it was first posted, but that's one heck of a great idea!I miss Aaron
April 6, 200620 yr @Yzöwl, depending on your posts I see you using either:FOR %%? IN ('MOUNTVOL^|FIND ":\"') DO ...Or FOR %%? IN (C D E F G H I J K L M N O P Q R S T U V W X Y Z) DO ...And now adding this nice CALL :SUB "%%?:" &&GOTO START trick to the later.Are you researching for the best way to do it or is there specific reasons for picking up this or that method?
April 6, 200620 yr Well, I'm glad you asked!NO, I still prefer MOUNTVOL, it is however not guaranteed to pick up on every drive.Because everyone is using the (A B C... version, and that method is the one used in 'The Guide' I thought it more prudent to not confuse things.What this method actually does is, hopefully, run through the letters one at a time as usual, but, when it finds a match it breaks out of the loop. If therefore the CD-ROM is at drive H, the loop doesn't continue to look for I:\$OEM$, J:\$OEM$..., Z:\$OEM$.It is also 'more robust' because:If CMDOW is either in PATH or local to the batch it will hide the window, if it isn't then echoing is turned off. Obviously if the window is hidden, then echoing doesn't matter.It doesn't prevent the remote possibility of a CD-ROM on C:, but will not search whatever is appointed as the System Drive.It doesn't set a variable to the CDROM drive, when it isn't needed.It will only copy the contents of the $OEM$ folders if they are there, and in that case, if the window isn't hidden, you will not get a screen output of how many files were copied.If you have already redirected your profile directories using winnt.sif or other method, then it doesn't limit the location of those files to the System Drive.
April 6, 200620 yr Yes I'm really impressed. I loved that "%ALLUSERSPROFILE%\.." and your first line as much as your "PUSHD %OEM%||PUSHD %SYSTEMDRIVE%" in another thread.Batch scripting can be a bit harsh, but you know how to put oil in it.
Create an account or sign in to comment