1.

Solve : Batch to check for Media location before rest of batch is executed?

Answer»

Anyone KNOW the % % command to find media in a system with multiple CD or DVD drives?

Unfortunately it cant be FIXED with just creating the media to autorun on whichever drive its loaded from.... That would have been way to easy... ha ha

Most systems have just a single CD or DVD Rom, but my batch is failing to execute on systems with more than one CD or DVD Drive, if the batch doesnt land on the 50 -50 chance of the correct drive.

Is there a test condition I should be using to find the media on the other drive?

Please post a snippet of batch code on how to go about doing this...

Thanks in advance! ... Davebetter if you post the problem code and then we can advise you how to MODIFY it.

For a start, we don't know your drive letters or what kind of media you are talking about. (That probably won't stop CERTAIN teen hotshots from indulging in some guessology, but never mind them)
Is this a batch file that is running from the CD drive in question? If so you can use %~d0
Like:
Code: [Select]echo The drive letter is %~d0Otherwise, you can loop through the optical drives that you found with the VOL command to see which one has the volume label you are LOOKING for.
Thanks Guru ... That works ... I was able to use VOL to find the CD no matter which drive it was inserted into since the volume is always acct_updt for the Accounting Systems Update CD.

Thanks for your help! Many Thanks!!!!

Dave



Discussion

No Comment Found