Link to home
Start Free TrialLog in
Avatar of sscal
sscalFlag for United States of America

asked on

Find Drive letter of CD-ROM in DOS

Good day everyone. We have a DOS mahcine in the office and are trying to find out what the drive letter for it is or if it is even assigned a drive letter at all. How can we find out if it has a drive letter and if it does not how do we get it to work? The mahcine in question only has DOS installed, no other OS.
Avatar of Trackhappy
Trackhappy
Flag of Australia image

Man, you are asking a lot from the old grey matter...

What version of DOS?

view the contents of the config.sys and autoexec.bat files in the root directory. The drivers for the cd should be run from there if I remember correctly and normally specified a drive letter to use.
Avatar of sscal

ASKER

It is running MS-DOS 6.22
Man, that brings back nasty memories. ;).
c:
cd\
type config.sys
type autoexec.bat

look for things like device=cdrom.sys in the config.sys file.
SOLUTION
Avatar of Trackhappy
Trackhappy
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Determine CD drive letter using a temporary vbs script...
@echo off
echo DL="none" >%tmp%\driveletter.vbs
echo Set C = CreateObject("Scripting.FileSystemObject").Drives >>%tmp%\driveletter.vbs
echo For Each D In C: If D.DriveType = 4 Then DL=D.DriveLetter >>%tmp%\driveletter.vbs
echo Next >>%tmp%\driveletter.vbs
echo WScript.Echo DL >>%tmp%\driveletter.vbs
for /f "tokens=1" %%a in (
'cscript.exe //Nologo %tmp%\driveletter.vbs') do set cd_driveletter=%%a

del %tmp%\driveletter.vbs
echo CD-ROM drive letter: %cd_driveletter%:

Open in new window

Without vbs script using standard Windows file system utility- Fsutil.exe...
@echo off
set cdrom=none
for %%a 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 (
fsutil.exe fsinfo drivetype %%a:|find "CD-ROM">nul&&set cdrom=%%a:
)
echo CD-ROM drive letter: %cdrom%

Open in new window

The version with vb script only works under windows.

Don't know whether fsutil.exe exists under DOS 6.22!!!!

Please try if it works...
How to find out if cd-rom has a drive letter:

Insert a cd into the cd-rom drive (you should know the contents of the cd)

Type in DIR C: at dos prompt

if drive C exists you will see the contents of the drive C

Try DIR D:

if drive D exists you will see the contents of the drive D:
if it not exists you will get the error message "The system cannot find the drive specified."

Go on further with drive letters E:, F:, ... until you get back the contents of your CD

If you've reached Z: and did not get your CD contents until that, there is no CD drive defined...




You can also check your drives by a batch script...
DIR A:
PAUSE
DIR B:
PAUSE
DIR C:
PAUSE
DIR D:
PAUSE
DIR E:
PAUSE
DIR F:
PAUSE
DIR G:
PAUSE
DIR H:
PAUSE
DIR I:
PAUSE
DIR J:
PAUSE
...

Open in new window

Avatar of sscal

ASKER

Trackhappy, I didn't see any idication of a cd rom drive listed in either the autoexec or config files. We have the drive setup in multiple partitions so C, D, E, and F are taken up. I couldn't find any other drive letter in use by perfomring dir on all possible drive letters.

Where would I find the driver for the cd rom? The drive has been installed for a long time but I don't think it was ever set up.
SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sscal

ASKER

OK so here is what I did. I grab the Oakcdrom.sys driver from the website above. I placed it in a folder on the C drive. I found the MSCDEX.exe file in the C;\DOS folder. I tried to use the drive letter "G" for the cdrom but it states every time I restart the computer the following:

Illegal Option 'G'
Usage:MSCDEX [/E/K/S/V] [/D:<DRIVER> ...] [/L:<LETTER>] [/M:<BUFFERS>]

included is the config and autoexec file contents.
Autoexec:
LH /L:0;1,11168 /S C:\NET\net initialize
@ECHO OFF
LH /L:0;1,45456 /S C:\DOS\SMARTDRV.EXE /X
SET CONFIG=E:\O5\CONFIG.ORA
SET INCLUDE=D:\QC\INC
SET TEMP=C:\TEMP
SET LIB=D:\QC\LIB
path c:\g;c:\glpt2;c:\w;c:\dbase;c:\dos;d:\qc\bin;e:\o5\pbin;e:\o5\bin;c:\net
LH /L:1,6384 C:\DOS\DOSKEY
LOADHIGH=C:\DOS\MSCDEX.EXE /G:MSCD001

C:\NET\netbind.com
LH /L:0;1,736 /S C:\NET\umb.com
C:\NET\tcptsr.exe
LH /L:0;1,2640 /S C:\NET\tinyrfc.exe
C:\NET\nmtsr.exe
LH /L:0;1,1184 /S C:\NET\emsbfr.exe
C:\NET\net start
d:
cd\qc\cadie08

Config:
DEVICE=C:\DOS\HIMEM.SYS
DEVICE=C:\DOS\EMM386.EXE RAM auto X=CC00-CDFF
BUFFERS=20,0
FILES=120
DOS=UMB
LASTDRIVE=Z
FCBS=4,0
DEVICEHIGH /L:1,18192 =C:\SIIGASPI\SIGASPI.SYS /D
DEVICEHIGH=C:\CDROM\OAKCDROM.SYS /G:MSCD001
DEVICE=C:\SIIGASPI\INIDISK.SYS
DOS=HIGH
DEVICEHIGH /L:1,4656 =C:\NET\IFSHLP.SYS

Open in new window

Avatar of sscal

ASKER

When I try to go to the G drive it states "Invalid Drive Specification"
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Here's the Microsoft page on MSCDEX: http://support.microsoft.com/kb/87165

Looks like "/G:MSCD001" should be "/D:MSCD001", 'D' for driver name, not drive letter.

Also, if this is a SCSI drive instead of IDE, it requires a different driver, not MSCDEX.
Avatar of sscal

ASKER

leew and everyone, thank you very much. Issue solved!
By the way... just to note... you could call the driver "SMEDLEY" if you wanted... it's just a name:

DEVICEHIGH=C:\CDROM\OAKCDROM.SYS /D:SMEDLEY
LOADHIGH=C:\DOS\MSCDEX.EXE /D:SMEDLEY /L:G