Theimon Posted October 9, 2004 Share Posted October 9, 2004 I've used the following method in RunOnceEx.cmd::: SET CDROM=%CD:~0,2%:: for %%a 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 exist %%a:\path\to\yourfile.xyz set CDROM=%%aIF EXIST D:\WIN51 set CDROM=D:IF EXIST E:\WIN51 set CDROM=E:IF EXIST F:\WIN51 set CDROM=F:IF EXIST G:\WIN51 set CDROM=G:IF EXIST H:\WIN51 set CDROM=H:IF EXIST I:\WIN51 set CDROM=I:IF EXIST J:\WIN51 set CDROM=J:But still, setups starts copying ALL my files. But I just want it to copy the necessary Windows-setup files. Not all the programs. I want the bigger part to install from DVD.How will I get this working? PS: I used the search in all kinds of ways but didn't come up with a satisfying answer :| Link to comment Share on other sites More sharing options...
CoffeeFiend Posted October 9, 2004 Share Posted October 9, 2004 You seem to have a few things confused.:: SET CDROM=%CD:~0,2% I don't use that one, but you'd have to pass something to it... (looks like a registry export method that I had seen - which you don't have... anyways):: for %%a 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 exist %%a:\path\to\yourfile.xyz set CDROM=%%a: does work 100% (the one I use)IF EXIST D:\WIN51 set CDROM=D:IF EXIST E:\WIN51 set CDROM=E:IF EXIST F:\WIN51 set CDROM=F:IF EXIST G:\WIN51 set CDROM=G:IF EXIST H:\WIN51 set CDROM=H:IF EXIST I:\WIN51 set CDROM=I:IF EXIST J:\WIN51 set CDROM=J: does the essentially same thing as the previous, but with more lines and less drives. (no advantage over previous/cleaner method)these 3 are only used set your CDRom variable, and nothing more. It won't affect what get copied or not to your HD by any means. What you put in $OEM$ WILL be copied no matter what. You have to place them somewhere else on your disc. Link to comment Share on other sites More sharing options...
Theimon Posted October 9, 2004 Author Share Posted October 9, 2004 What you put in $OEM$ WILL be copied no matter what. You have to place them somewhere else on your disc.This I didn't know (and didn't find anywhere). So if I place them elsewhere (like in Extra or something) then they won't be copied. Won't that affect the installation in any way? What IS necessary to put in the $OEM$ folder? Can I place all programs in Extra or are some programs essential in the $OEM$ folder?Thanks for your fast reply by the way Link to comment Share on other sites More sharing options...
CoffeeFiend Posted October 9, 2004 Share Posted October 9, 2004 Well, it's hard to make a list of what should or should not be copied to the HD.What I copy:-drivers in $OEM$\$1\Drivers-command.cmd in $OEM$\$1 (for my GUIRunOnce)-apps installed (copied) by $ORM$\$Progs (winhttrack, zoom player, winzip, ...LOTS!)-a bunch of command line utilities and such in $OEM$\$$ (devcon.exe, pskill.exe, ...)What I don't copy/do place somewhere else: everything else. I put it all in a "install" directory in the root of the DVD. Then you call the installers like:"%CDRom%\install\app name\setup.exe" /S(or whatever, with appropriate paths, switches and all)The only thing with installing directly from CD/DVD instead of HD is with InstallShield you gotta use the -f2 (and preferably -f1 too). Otherwise it's all the same.Hope that heps Link to comment Share on other sites More sharing options...
Theimon Posted October 10, 2004 Author Share Posted October 10, 2004 Ok thanks. This sure helps. I'll take a look at what to move and what not. I'd like it to copy at least as possible so it's gonna be a lot of moving I guess Thx for the help Link to comment Share on other sites More sharing options...
ran Posted November 5, 2004 Share Posted November 5, 2004 OK, this is weirdWhy does this work:FOR %%a 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 exist %%a:\XPProSP2.txt set CDROM=%%a:But this does not:FOR %%a 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 Dir %%a\XPProSP2.txt > NUL && SET CDROM=%%a: || echo %%a failedThe second code actually puts a *space* after the %CDrom% variable.In other words, if the cdrom was in M:, the first would have this path: M:\mystuffBut, the second does this: M:\ mystuff (note the space after the '\')Why???? I need to do the second because I find that the batch crashes if there are empty drives in line before the install CD (e.g. another CD drive, or some empty flash card drives). Piping the dir output to Null gives me a fail/not fail result and doesn't crash the batch.....Ran Link to comment Share on other sites More sharing options...
Theimon Posted November 5, 2004 Author Share Posted November 5, 2004 Sorry, I can't help you with that one 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