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
C>TRUENAME F:\
\\F.\A.\
C>
|
TRUENAME uses the function 60h of the interruption 21h, which has been available since DOS 3.
Other examples in a Windows 98 "DOS session" :
C:\DOC\>TRUNENAME BLABLA
C:\DOC\BLABLA
C:\DOC\>TRUENAME NUL
C:/NUL
C:\DOC\>TRUENAME AUX
C:/AUX
C:\DOC\>TRUENAME COM1
C:/COM1
C:\DOC\>TRUENAME PRN
C:\LPT1
C:\DOC\>TRUENAME LPT1
C:\LPT1
C:\DOC\>TRUENAME LPT2
C:/LPT2
C:\DOC\>
|
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:\DOC>TRUENAME BLABLA\NUL
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:
C:\DOC>TRUENAME \DEV\NUL
C:/NUL
|
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
code segment
assume cs:code, ds:code
org 100h
Depart:
mov ah,30h ; Check DOS version -------------
int 21h
cmp al,3 ; At least DOS 3 ?
jb Vieux_DOS ; Else error
mov bx,81h ; DTA Start --------------------
mov si,bx
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
Tab:
cmp al,9 ; Table ?
jne Suite ; Else no white character
jmp Cmp_blanc
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
int 21h
mov si,di ; Display the path -----------------
mov ah,2 ; Function to display characters
Sortie_car:
lodsb ; AL = [DS:SI] and IF increment
or al,al ; null characters ?
jz Fin ; If yes, end
mov dl,al
int 21h
jmp Sortie_car
Fin:
ret
Vieux_DOS:
mov ah,9
mov dx,offset msg_VieuxDOS
int 21h
ret ; End
tampon db 128 dup(0) ; Complete path in ASCIIZ format
msg_VieuxDOS db 13,10,'Require DOS 3 at least',13,10
code ends
end Start
|
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:
C:\
[DR DOS] C:\DOC\>vrainom g:\
C:\DRDOS
[DR DOS] C:\DOC\>vrainom c:
C:\
[DR DOS] C:\DOC\>vrainom c:\
C:\
[DR DOS] C:\DOC\>vrainom f:
F:
[DR DOS] C:\DOC\>vrainom f:\
F:
[DR DOS] C:\DOC\>vrainom f:\BlaBla
F:\BLABLA
[DR DOS] C:\DOC\>vrainom BlaBla\file
C:\DOC\BLABLA\FILE
[DR DOS] C:\DOC\>vrainom BlaBla\nul
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