May 16, 200620 yr I've searched for a post about this and couldn't find anything, but I think I may have figured it out. What I want to do is keep one CD with just Windows w/current hotfixes and one CD with current drivers/apps that I want to install. And I want the Windows installation to call the installation of the drivers/apps from the other CD. The reason for this is I can keep my Windows CD intact and only have to modify my drivers/apps CD for newer versions or changes for apps that I want to install. I figure WPI is an excellent choice for installing the drivers/apps this way, I just need to be able to call WPI from the Windows installation while having it run from a different CD. After editing the WPI.cmd this is what I came up with:I changed the CD-check file from WPI.ico to CD.txt to establish the %CDROM% variable. I did this because I need to check the drives/apps CD for the WPI.ico file to make sure the right CD is in the drive. Of course there will now have to be a CD.txt file at the root of both CDs.REM Example, how to look for CDROM-drive. Must have WPI.ico at the root of the CD.for %%i 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 %%i:\WPI.ico set CDROM=%%i:echo Found CD-Rom as drive %CDROM%changed to:REM Example, how to look for CDROM-drive. Must have CD.txt at the root of the CD.for %%i 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 %%i:\CD.txt set CDROM=%%i:echo Found CD-Rom as drive %CDROM%I then added these lines to check for the correct CD before continuing with WPI:REM Determine if CD in CDROM-drive is WPI CD.:WPIcheckif exist %CDROM%:\WPI.ico goto WPIecho Please insert WPI CD in drive %CDROM%:pausegoto WPIcheck:WPILastly I changed wpipath to run from CD::WPIREM Determine the WPI startup path. REM if wpi should run off the cd the replace %~dp0 with %CDROM%.set wpipath=%CDROM%That's it. Could some please double check my scripting to see if this will have the correct result?Thanks in advance.
May 16, 200620 yr You have to make sure your CDs _both_ have cd.txt or whatever id file you want on them. After that, you have to either take out the cmdow @ hid line, or add your custom check for correct cd line before it. Something like this:REM Example, how to look for CDROM-drive. Must have CD.txt at the root of the CD.for %%i 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 %%i:\CD.txt set CDROM=%%i:if exist %cdrom%\cd.txt goto existsgoto notexists:existsif exist %cdrom%\cd1.txt goto cd1goto cd2:cd1rem The commands for CD1 go on the next linegoto exit:cd2rem The commands to be executed for CD2 go on the next linegoto exit:exitrem Put any commands (such as cleanup and the like) on the next lineexitAfter that, your good to go!~~HH Edited May 16, 200620 yr by HeliumHigh
May 25, 200620 yr Sounds like a great idea. Did you ever get this figured out? If so can you post the code? Thanks
Create an account or sign in to comment