Aaron Posted April 14, 2004 Share Posted April 14, 2004 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. Link to comment Share on other sites More sharing options...
tim Posted April 15, 2004 Share Posted April 15, 2004 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. Link to comment Share on other sites More sharing options...
Aaron Posted April 15, 2004 Author Share Posted April 15, 2004 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) Link to comment Share on other sites More sharing options...
Alanoll Posted April 15, 2004 Share Posted April 15, 2004 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 Link to comment Share on other sites More sharing options...
tim Posted April 15, 2004 Share Posted April 15, 2004 Ah I see. That's good.I wanna run some reg tweaks but still need the F6 option.Thanks. Link to comment Share on other sites More sharing options...
Aaron Posted April 15, 2004 Author Share Posted April 15, 2004 You should still be able to run regtweaks, what trouble are you having? Link to comment Share on other sites More sharing options...
tim Posted April 15, 2004 Share Posted April 15, 2004 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! Link to comment Share on other sites More sharing options...
Yzöwl Posted April 5, 2006 Share Posted April 5, 2006 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. Link to comment Share on other sites More sharing options...
RyanVM Posted April 5, 2006 Share Posted April 5, 2006 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 Link to comment Share on other sites More sharing options...
Djé Posted April 6, 2006 Share Posted April 6, 2006 @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? Link to comment Share on other sites More sharing options...
Yzöwl Posted April 6, 2006 Share Posted April 6, 2006 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. Link to comment Share on other sites More sharing options...
Djé Posted April 6, 2006 Share Posted April 6, 2006 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. Link to comment Share on other sites More sharing options...
JuMz Posted June 19, 2008 Share Posted June 19, 2008 Thanks for this post! Came in handy! Link to comment Share on other sites More sharing options...
COKEDUDEUSF Posted July 12, 2008 Share Posted July 12, 2008 Whats the advantages and disadvantages of doing this? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now