Jump to content

Utility for changing CD-s


Recommended Posts

I've created a utility for changing CDs

It ejects the CD and asks for the second or third CD, checks the label in every CD-ROM, finds out drive letter and if it is the write CD executes a file otherwise ejects and checks again until the write CD is inserted or cancel pressed (pressing cancel executes another file).

It has 3 parameters

1. CD Label to be checked and displayed.

2. Batch file to be executed (must be on the CD as it returns drive letter and command specified in this parameter)

3. Batch file to be executed when cancel pressed.

This is universal as it takes Labels and commands by parameters so you can use it for many CDs.

Feel free to ask me if you have questions.

install.exe

Link to comment
Share on other sites


Start it with 3 parameters

install.exe par1 par2 par3

par1 = CD Label to be checked

par2 = Command to be exexuted when it finds the CD (note that it returns drive letter of CD-ROM and you need to give only command with \ )

par3 = Command to be executed when cancel pressed

here is an example

............................
ECHO Removing useless shortcuts...
DEL "%systemdrive%\Documents and Settings\All Users\Start Menu\Windows Update.lnk"
DEL "%systemdrive%\Documents and Settings\All Users\Start Menu\Set Program Access and Defaults.lnk"
DEL "%systemdrive%\Documents and Settings\All Users\Start Menu\Windows Catalog.lnk"
ECHO.

start /wait install.exe "Applications CD" \setup.cmd %SystemDrive%\install\cleanup.cmd
EXIT

The program will check for the CD labeled "Applications CD" and execute setup.cmd in that CD with parameter which is drive letter so you can easyly get drive letter in your batch file here is an example

cmdow @ /HID
@Echo Off

SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx

REG ADD %KEY% /V TITLE /D "Installing Programs" /f

REG ADD %KEY%\000 /VE /D "Acdsee 6.0.6" /f
REG ADD %KEY%\000 /V 1 /D "%1\defaults\ACDSee6\acdsee6.msi /qn REBOOT=Suppress" /f

REG ADD %KEY%\015 /VE /D "Acrobat Reader 6.0.2" /f
REG ADD %KEY%\015 /V 1 /D "%1\defaults\AR6\setup.exe /S /v/qn" /f
REG ADD %KEY%\015 /V 2 /D "%1\defaults\AR6\6.0.2_Update.exe /S /v/qn" /f
............................

%1 is given from install.exe and is drive letter

You can even add it in RunOnceEx during installation to change another CD

Link to comment
Share on other sites

  • 4 weeks later...

Have only done a basic test.

Made a bat file, and ran it on pc and it ejected cd and started to the run setup with no issues.

The command I used was

start /wait install.exe "NMC_Apps" \visio\seup.exe

So am guessing that to add this to my unonceex.cmd, i just need to add that line at the end? or does it need to be runceex.cmd style with the reg add key parts as well?

Thank you

Link to comment
Share on other sites

  • 4 weeks later...
  • 4 weeks later...
  • 2 weeks later...

Hi ankap , Thanks for the script, just what i was after but..

im not sure if ive implemented it right. (NOob)

it asks for the cd, put it in , click ok and the i get this error

error.gif

My batch files

CLS
@echo off
TITLE Windows XP SP2 - Unattended Installation

ECHO Applying Registry Tweaks...
REGEDIT /S %systemdrive%\install\RegTweaks.reg
ECHO Starting installation of Applications

ECHO Installing Opera v7.54
ECHO Please wait...
start /wait %systemdrive%\install\opera\o754_3869.exe /s

ECHO Please wait...
start /wait %systemdrive%\install\install.exe "Applications_CD" \setup_office2003.cmd %SystemDrive%\install\cleanup.cmd

ECHO Restarting the PC in 4 minutes...
shutdown.exe -r -f -t 240 -c "Windows XP will now restart in 4 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%\Drivers
RD /S /Q %systemdrive%\install
EXIT

On The Applications_CD.iso CD ive the following

@echo off
TITLE Windows XP SP2 - Unattended Installation (office cd)
ECHO.

ECHO.
ECHO Installing Office
ECHO Please wait...
start /wait %1\Office2003\setup.exe TRANSFORMS=Unattended.MST /qb-

ECHO Restarting the PC in 4 minutes...
shutdown.exe -r -f -t 240 -c "Windows XP will now restart in 4 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%\Drivers
RD /S /Q %systemdrive%\install
EXIT

ive also a cleanup.cmd file too.

This is really bugging me, my first attempt at batch files.

Big up too all the MSFN massive, great site. :thumbup

Link to comment
Share on other sites

Look its smth wrong with your setup_office2003.cmd file. Is it in the root of your CD ? Cause it can't find that file. The program tries to run file G:\setup_office2003.cmd (g: is your CD-ROM letter) so it must be in the root of your CD.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...