Rob van der Woude's Scripting Pages

Find RAMdisk drive letter in Windows 95/98

FINDRAMD ships with Windows 98.
It is used to determine the drive letter used by a RAMdisk.
You can find it on the Emergency Boot Diskette that Windows creates right after its installation and in the C:\WINDOWS\COMMAND\EBD directory.

Usage:

FINDRAMD  [ /? ]

sweeps all possible drive letters to find ramdrive
returns errorlevel for drive (C:=3)

The following batch file will display the RAMdisk drive letter:

@ECHO OFF
REM Search for RAMdisk and store its drive
REM letter in environment variable RAMDRIVE

FINDRAMD

IF ERRORLEVEL 255 GOTO NoRamDrive
IF NOT ERRORLEVEL 3 GOTO NoRamDrive

IF ERRORLEVEL  3 SET RAMDRIVE=C:
IF ERRORLEVEL  4 SET RAMDRIVE=D:
IF ERRORLEVEL  5 SET RAMDRIVE=E:
IF ERRORLEVEL  6 SET RAMDRIVE=F:
IF ERRORLEVEL  7 SET RAMDRIVE=G:
IF ERRORLEVEL  8 SET RAMDRIVE=H:
IF ERRORLEVEL  9 SET RAMDRIVE=I:
IF ERRORLEVEL 10 SET RAMDRIVE=J:
IF ERRORLEVEL 11 SET RAMDRIVE=K:
IF ERRORLEVEL 12 SET RAMDRIVE=L:
IF ERRORLEVEL 13 SET RAMDRIVE=M:
IF ERRORLEVEL 14 SET RAMDRIVE=N:
IF ERRORLEVEL 15 SET RAMDRIVE=O:
IF ERRORLEVEL 16 SET RAMDRIVE=P:
IF ERRORLEVEL 17 SET RAMDRIVE=Q:
IF ERRORLEVEL 18 SET RAMDRIVE=R:
IF ERRORLEVEL 19 SET RAMDRIVE=S:
IF ERRORLEVEL 20 SET RAMDRIVE=T:
IF ERRORLEVEL 21 SET RAMDRIVE=U:
IF ERRORLEVEL 22 SET RAMDRIVE=V:
IF ERRORLEVEL 23 SET RAMDRIVE=W:
IF ERRORLEVEL 24 SET RAMDRIVE=X:
IF ERRORLEVEL 25 SET RAMDRIVE=Y:
IF ERRORLEVEL 26 SET RAMDRIVE=Z:

IF ERRORLEVEL 27 GOTO NoRamDrive

ECHO RAMdisk drive letter is %RAMDRIVE%
GOTO End

:NoRamDrive
ECHO Unable to locate RAMdisk
SET RAMDRIVE=

:End

Thanks for Jason Brown, who corrected a "fatal" typo.

 

Windows XP and later

In Windows XP Professional and later versions, use WMIC to find RAM disks:

WMIC.EXE Path Win32_LogicalDisk Where "MediaType=6" Get DeviceID

 


page last modified: 2011-03-04; loaded in 0.0018 seconds