Whereas SUBST assigns a drive letter to a folder, MSCDEX uses the network redirection to make a CD-DROM drive exploitable as DOS drive.
The CD-ROM drive is actually considered as a network one. If MSCDEX is loaded without /S option (sharing of CD-ROM units for servers), the TRUENAME internal command makes possible to know the drive UNC designation. For instance, if F: is the first CD-ROM drive, we obtain that
TRUENAME uses the function 60h of the interruption 21h, which has been available since DOS 3.
Other examples in a Windows 98 "DOS session" :
BLABLA doesn't necessarily exist but it's a correct file name (or folder one). NUL and the followers are DOS devices. AUX and COM1 are two different names for the same device. That's the same for PRN and LPT1, except the fact Windows replaces parallel port with a file. Another difference between MS-DOS mode and MS-DOS session:
C:\BLABLA\NUL in MS/DOS mode
C:/NUL on Windows
However, this distinctive feature of MS-DOS mode is not confirmed with on the \DEV folder:
Indeed, \DEV is a prefix of device name since MS-DOS 2 (parallel to UNIX).
P.S : because the TRUENAME command is not present on DOS 3.x COMMAND.COM, we can create an utility to fit that function:
; VRAINOM.COM - utility using the DOS 60h undocumented feature.
; Display the path in a detailed form.
; masm vrainom;
; link vrainom;
; exe2bin vrainom vrainom.com
assume cs:code, ds:code
mov ah,30h ; Check DOS version -------------
cmp al,3 ; At least DOS 3 ?
jb Vieux_DOS ; Else error
mov bx,81h ; DTA Start --------------------
Cmp_blanc: ; Obtain the first non-white character ------
lodsb ; Character [DS:SI] in AL, if show follow.
cmp al,20h ; Space ?
jne Tab ; Else table maybe
cmp al,9 ; Table ?
jne Suite ; Else no white character
Suite: ; Obtain the absolute path -----------
dec si ; First non-white characters
add bl,ds:80h ; Read number of characters in DTA
mov byte ptr [bx],0 ; Put the chain in ASCIIZ format
mov di,offset tampon
mov ah,60h ; Input of this function : DS:SI et ES:DI
mov si,di ; Display the path -----------------
mov ah,2 ; Function to display characters
lodsb ; AL = [DS:SI] and IF increment
or al,al ; null characters ?
jz Fin ; If yes, end
mov dx,offset msg_VieuxDOS
ret ; End
tampon db 128 dup(0) ; Complete path in ASCIIZ format
msg_VieuxDOS db 13,10,'Require DOS 3 at least',13,10
Now, suppose we are on DR-DOS (compatible with Compaq DOS 3.31), F: is still a CD-ROM drive created by MSCDEX (necessarily without /S option, which is not compatible with that DOS). We're going to assign a letter to a folder before testing the utility:
[DR DOS] C:\DOC\>cd g:=c:\drdos
[DR DOS] C:\DOC\>vrainom g:
[DR DOS] C:\DOC\>vrainom g:\
[DR DOS] C:\DOC\>vrainom c:
[DR DOS] C:\DOC\>vrainom c:\
[DR DOS] C:\DOC\>vrainom f:
[DR DOS] C:\DOC\>vrainom f:\
[DR DOS] C:\DOC\>vrainom f:\BlaBla
[DR DOS] C:\DOC\>vrainom BlaBla\file
[DR DOS] C:\DOC\>vrainom BlaBla\nul
[DR DOS] C:\DOC\>
On DR-DOS, a 60h function doesn't display a network drive in UNC form but indicates its main folder as a simple driver letter.
P.S. : two years later, I found a website which gethers undocumented features and alternative utilities for MS-DOS 5 and higher: http://www.mdgx.com/secrets.htm