Computing.Net > Forums > Programming > batch file and CD problems

batch file and CD problems

Reply to Message Icon

Original Message
Name: harry349
Date: November 20, 2004 at 03:42:50 Pacific
Subject: batch file and CD problems
OS: Win98SE / DOS
CPU/Ram: Athlon XP 1700+ / 768MB
Comment:

I am booting off a Win98SE boot disk with CD-ROM support. In the AUTOEXEC.BAT, the last line reads something like:

%CDROM%:\foo\foo.exe

So it tries to run an executable from the CD-ROM drive when it's done booting.

This all works fine and good if the CD happens to be in the "first" CD-ROM drive in the system. If not, it fails miserably with a CDR101 error - the typical error you would get if trying to access a file from a CD-ROM drive that is currently empty.

I also tried:

if exist d:\foo\foo.exe ...

but the if exist line also displays error CDR101 if there is no disc in the drive.

Does anyone have a reasonable solution to this problem? I just want the boot procedure to automatically run an executable off the CD without any prompts or error messages, and I want it to work regardless of which CD drive it is in.

TIA
harry349


Report Offensive Message For Removal


Response Number 1
Name: KRB
Date: November 20, 2004 at 07:16:49 Pacific
Reply: (edit)

It is some thing to do with setting MASTER/ SLAVE and prymary/ secondary setting of CD rom.
It is hardware connection with ribbon cable to mother board or jumper setting of CDROM.
Check this out.


Report Offensive Follow Up For Removal

Response Number 2
Name: wizard-fred
Date: November 20, 2004 at 07:28:06 Pacific
Reply: (edit)

The best solution is to use a fixed letter for the CD drive that you want to access and put the CD into the drive.

You need a utility that would test whether there is a CD installed, but you would have the same problem if the wrong CD was inserted.

I have a 5 disk CD changer, which depending upon the driver has 5 drive letters, or a single letter. Think of the problem then.


Report Offensive Follow Up For Removal

Response Number 3
Name: harry349
Date: November 20, 2004 at 10:10:49 Pacific
Reply: (edit)

wizard-fred

That's an interesting idea about a utility that tests whether or not a CD is in the drive. If I know there is a CD in the drive, then I'm set. A series of

if exist d:\foo\foo.exe d:\foo\foo.exe

for each drive letter would work fine. Actually I'd probably use a series of gotos so it doesn't try all the other drives after I exit the program but before the batch file completes. Now I just need to find such a utility and see if I can harness its output from a batch file.

I am aware I could change around the order of the drives by physically cabling them differently inside the PC, but I'm trying to avoid that.

Thanks for your input.


Report Offensive Follow Up For Removal

Response Number 4
Name: harry349
Date: November 20, 2004 at 11:10:46 Pacific
Reply: (edit)

FYI - I found just such a utility, and it works great. It's called FindCD.

http://www.nu2.nu/utils/

Thanks again for the input.


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: batch file and CD problems

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




Have you ever used OpenOffice?

Yes, as my main suite.
Yes, occationally.
Yes, but only once.
No, never.


View Results

Poll Finishes Today.
Discuss in The Lounge