cyberdiamond Posted August 5, 2003 Share Posted August 5, 2003 To run a 2nd CD you will have to have an exact drive letter and path your CD-ROM in your batch file on the Windows XP CD.This can be a problem if you decide to use your custom CD on another PC that may have different drive letters.e.g. instead of %systemroot%\install\Applications, you will have to use X:\Applications\ (X:\ being the CD-ROM Drive) You can use a variable to do thisSo you will only have to change one line of codeSet CDRom2=X:"%CDRom2%\extra path here" would equal"X:\extra path here"But this is still not good enough for me as I have a DVDRom and a CDRW.I would like to put a cd in each drive and walk away!(and have them eject at the appropriate times)I am sure we could get a batch or something to seek out as many drives as we have and assign them to variables etc.E.g. seach you computer for optical drives and automatically asign their drive letters to variablesI just don't have a lot of time atm! Link to comment Share on other sites More sharing options...
Marztabator Posted August 6, 2003 Share Posted August 6, 2003 Or, as I worked out today, if you have two CD drives, and you've made 2 CDs (making sure the correct drive letters are used), simply insert both discs at startup and relax! Link to comment Share on other sites More sharing options...
cyberdiamond Posted August 13, 2003 Author Share Posted August 13, 2003 That's fine but I use this cd on different machines so I can't hard code the cd letter!Anyone? Link to comment Share on other sites More sharing options...
ashfaq_t Posted August 16, 2003 Share Posted August 16, 2003 I have found the perfect tools for the job.Look ath**p://willowhayes.co.uk/The program getcd.exe finds the drive letter of the first cdrom drive on the machine and can be used as a part of a batch file.Thanks Oli for the great program!!!! Link to comment Share on other sites More sharing options...
ashfaq_t Posted August 17, 2003 Share Posted August 17, 2003 Aaron,Could you please put up step by step instructions on the unattended cd website how to incorporate the getcd program into the batch file. The batch should ask for the second cdrom and then continue to install the other programs directly from that cdrom without copoying them to the hard disk first.I am sure that a lot of people want to add a lot of programs to their cd but cannot because of lack of space on the cd. This solution would solve all their problems.I would then request you to add the instructions to the main website as well so that all may benefit.Thanks. Link to comment Share on other sites More sharing options...
cyberdiamond Posted August 19, 2003 Author Share Posted August 19, 2003 That's a good find pity it can't find all cd letters. eg if I have two cdroms it could give back two variables (%cdrom%, and %cdrom2% etc)I don't want much do I Link to comment Share on other sites More sharing options...
webmedic Posted August 19, 2003 Share Posted August 19, 2003 if anybody has that file I would apriciate it the site is down right now or at least I cant get to it. Link to comment Share on other sites More sharing options...
ashfaq_t Posted August 22, 2003 Share Posted August 22, 2003 The link is working now. Just tried it Link to comment Share on other sites More sharing options...
webmedic Posted August 22, 2003 Share Posted August 22, 2003 here this will do it or you. and will handle 2 cdroms.CLS@ECHO OFFSET CDROM=IF EXIST D:\$OEM$\$1\install\First_boot.cmd SET CDROM=D:IF EXIST E:\$OEM$\$1\install\First_boot.cmd SET CDROM=E:IF EXIST F:\$OEM$\$1\install\First_boot.cmd SET CDROM=F:IF EXIST G:\$OEM$\$1\install\First_boot.cmd SET CDROM=G:IF EXIST H:\$OEM$\$1\install\First_boot.cmd SET CDROM=H:IF EXIST I:\$OEM$\$1\install\First_boot.cmd SET CDROM=I:IF EXIST J:\$OEM$\$1\install\First_boot.cmd SET CDROM=J:IF EXIST K:\$OEM$\$1\install\First_boot.cmd SET CDROM=K:ECHO.IF EXIST %systemdrive%\install\hotfixes.cmd GOTO RUNCMDECHO If you only have one cdrom please remove your cdECHO from the cdrom and place the second cd in the drive.ECHO.ECHO If you have two cdroms then make sure your secondECHO cd is in the second cdrom drive.ECHO.PAUSEIF NOT EXIST %CDROM%\install\hotfixes.cmd GOTO RUNCMDxcopy %CDROM%\install %systemdrive%\install\ /S /C /Q /H /YECHO.:RUNCMDIF NOT EXIST %CDROM%\$OEM$\$1\install\First_boot.cmd GOTO RUNBATCHECHO Please remove your cd from the cdrom drive.ECHO.PAUSEECHO.IF EXIST %CDROM%\$OEM$\$1\install\First_boot.cmd GOTO RUNCMD:RUNBATCHECHO Running Main Batch ...ECHO.start /wait %systemdrive%\install\main_batch.cmd :: load from second cd without interventionIF NOT EXIST %systemdrive%\install\hotfixes.cmd GOTO APPSECHO Running Hotfixes Batch ...ECHO.start /wait %systemdrive%\install\hotfixes.cmd :APPSIF NOT EXIST %systemdrive%\install\applications.cmd GOTO CUSTOMECHO Running Applications Batch ...ECHO.start /wait %systemdrive%\install\applications.cmd:CUSTOMIF NOT EXIST %systemdrive%\install\CUSTOMIZE.CMD GOTO ERRORECHO Running Cumstom Batch ...ECHO.start /wait %systemdrive%\install\CUSTOMIZE.CMD :ERRORIF NOT EXIST %systemdrive%\install\hotfixes.cmd GOTO _ECHOIF NOT EXIST %systemdrive%\install\applications.cmd GOTO _ECHOIF NOT EXIST %systemdrive%\install\CUSTOMIZE.CMD GOTO _ECHOGOTO END:_ECHOECHO.ECHO *******************WARNING*******************ECHO Hotfixes or Applications were not installed ECHO because they could not be found.ECHO.ECHO Check %systemdrive%\install\install.log for ECHO more information.ECHO *******************WARNING*******************ECHO.PAUSE:ENDECHO.ECHO Restarting the PC in 1 minute...shutdown -r -f -t 30 -c "Windows XP will now restart in 1 minute, this will give enough time for the shortcuts to update and for the shell to fully load before its ready to restart!"ECHO.::ECHO Deleting Temp Installation Files...::RD /S /Q %systemdrive%\install::RD /S /Q %systemdrive%\Drivers::ECHO.EXIT Link to comment Share on other sites More sharing options...
Elkhound Posted August 30, 2003 Share Posted August 30, 2003 That looks like a pretty good batch file there, but I'm a little bit confused by it... I'm assuming that once you get to the point that the batch files are running, everything has already been copied to the hard drive... Or has it?If it has, then I guess it tells you and you can insert your 2nd Cd-ROM and add whatever applications you need.... Right?If you could drop a reply with some more info on that batch file, it'd be greatly appreciated!Elkhound Link to comment Share on other sites More sharing options...
webmedic Posted August 31, 2003 Share Posted August 31, 2003 Yes look at it carefully it will check to see witch drive o=is your cdrom then it will copy all the files from the second cdrom to your hard drive. Then it starts to run the extra cmd files from the second cdrom as well as the ones from the first cdrom. Then it finishes everything off and does a reboot. Link to comment Share on other sites More sharing options...
Oli Posted November 9, 2003 Share Posted November 9, 2003 I have found the perfect tools for the job.Look ath**p://willowhayes.co.uk/The program getcd.exe finds the drive letter of the first cdrom drive on the machine and can be used as a part of a batch file.Thanks Oli for the great program!!!! You're welcome. Sorry it took me so long to find you all! Link to comment Share on other sites More sharing options...
Oli Posted November 9, 2003 Share Posted November 9, 2003 That's a good find pity it can't find all cd letters. eg if I have two cdroms it could give back two variables (%cdrom%, and %cdrom2% etc)I don't want much do I program GetCD;{$APPTYPE CONSOLE}uses SysUtils, classes, Unit1 in 'Unit1.pas';var envlist: TStringList; i: integer;begin writeln(getcd(getdisks)+':');end.--------unit1.pas--------unit Unit1;interfaceuses classes, sysutils, windows;function GetCD(availdisks: string): string;function GetDisks:string;implementationfunction GetCD(availdisks: string): string;var i :integer; root :pchar;begin result:=chr(0); root:=stralloc(255); for i:=1 to length(availdisks) do begin strpcopy(root,copy(availdisks,i,1)+':\'); if getdrivetype(root)=drive_cdrom then begin result:=availdisks; break; end; end; strdispose(root);end;function GetDisks:string;var availdisks: string; i,n :integer; buf :pchar;begin buf:=stralloc(255); n:=GetLogicalDriveStrings(255,buf); availdisks:=''; for i:=0 to n do if buf<>#0 then begin if (ord(buf) in [$41..$5a]) or (ord(buf) in [$61..$7a]) then availdisks:=availdisks+upcase(buf) end else if buf[i+1]=#0 then break; strdispose(buf); result:=availdisks;end;end. Link to comment Share on other sites More sharing options...
djkappi Posted November 9, 2003 Share Posted November 9, 2003 i found this somewhere else on this forum:in cddrive.cmd:@echo off:startfor /F %%i IN ('dir /b %1:\win51') DO IF /I "%%i" == "win51" set CDDRIVE=%1:&& goto endshift /1goto start:endperhaps you'd like to change the file to be found (win51 in this example) on your second cd.and call it in your batch:CALL cddrive.cmd a b c d e f g h i j k l m n o p q r s t u v w x y zthis might be usefull. don't credit me for this, i forgot who posted it, sorry.Note: the first space in CDDRIVE=%1: && goto end (in the original posted batch) made paths look like c: \windows so i removed it and it works fine now 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