johnb6767
asked on
Need code to detect CDRom drive letter? All Windows Versions.....
Good evening/morning/afternoon.
Been a while since I haev been using this site, but it has always been a great source of answers.
I am creating a batch file, and I need to be able to (using a simple line of code) to accesss the systems registry, and automatically detect the first CDRom drive letter. I would like for the batch file to automatically be able to use the info it polls frm the system. The batch file will actually be installing programs, and creatinga directory on the c drive. Where this information will be necessary, is so that it can copy from (drive letter ) to the c:\(directory of coice).
I dont mind what kind of code is used. If it is something that can be incorporated into a DOS batch file, that would be ideal. If not I can probably change my type of setup file to some sort of self extracting file, that can execute my programs.
I look forward to the great answersr you guys will provide.
What version of Windows are you running this batch file on? 9x/Me, 2K/XP?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
you could try this:
if exist d:\autorun.inf goto DDRIVE
if exist e:\autorun.inf goto EDRIVE
if exist f:\autorun.inf goto FDRIVE
etc, etc,.
that is, assuming you have an autorun on the cd that's in there.
Hope this helps.
if exist d:\autorun.inf goto DDRIVE
if exist e:\autorun.inf goto EDRIVE
if exist f:\autorun.inf goto FDRIVE
etc, etc,.
that is, assuming you have an autorun on the cd that's in there.
Hope this helps.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.