Win3x.Org

Windows & DOS Community

MS-DOS: Microsoft's Undocumented Features

Répondre   Page 1 sur 1  [ 6 messages ]
Auteur Message
michel
Sujet du message : MS-DOS: Microsoft's Undocumented Features
Publié : 23 févr. 2011 15:40
Administrateur
Avatar de l’utilisateur
Hors-ligne
 
Messages : 2554
Inscription : 07 févr. 2003 19:46
PC Rétro : IBMPS2 mod85-DOS 6.22 - Windows 3.11 fwg
 
Microsoft's Undocumented Features
For MS-DOS users

These documents contain many undocumented parameters and options, although accessible to the user.

Often, these commands are accidentally found, as results of typos in the command-line interpreter.


Three examples:
  • FDISK /MBR, erases master boot record
  • DIR, displays all files regardless of their attributes
  • CHOICE /C:XM*; /N /T:2,5
    if errorlevel=4 goto help
    if errorlevel=3 goto end
    ...etc
    The "*" is the Escape key and the ";" is equal to F1
Good reading!

[en] Microsoft's Undocumented Features Volume 1 - N°6 (20 Ko) Clics : 48
[en] Microsoft's Undocumented Features Volume 1 - N°7 (64 Ko) Clics : 118


Dernière modification par Big Monstro le 18 sept. 2014 20:40, modifié 1 fois.

Haut
Profil Citer
gm86
Sujet du message : Re: MS-DOS: MUF Volume 1 n°7 [en]
Publié : 23 févr. 2011 18:03
Membre inscrit
Avatar de l’utilisateur
Hors-ligne
 
Messages : 500
Inscription : 01 sept. 2008 19:07
 
Some undocumented features are open secrets.

Since DOS 4, COMMAND.COM includes TRUENAME to give the complete path of any file or folder redirected by SUSBT, MSCDEX...

On DR-DOS, the "CD" internal command isn't useful just for changing folder but also to the same function as SUBST.


Haut
Profil Citer
michel
Sujet du message : Re: MS-DOS: MUF Volume 1 n°7 [en]
Publié : 23 févr. 2011 22:48
Administrateur
Avatar de l’utilisateur
Hors-ligne
 
Messages : 2554
Inscription : 07 févr. 2003 19:46
PC Rétro : IBMPS2 mod85-DOS 6.22 - Windows 3.11 fwg
 
I don't understand. MSCDEX has nothing to do with that


Haut
Profil Citer
gm86
Sujet du message : Re: MS-DOS: MUF Volume 1 n°7 [en]
Publié : 24 févr. 2011 10:42
Membre inscrit
Avatar de l’utilisateur
Hors-ligne
 
Messages : 500
Inscription : 01 sept. 2008 19:07
 
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

_________________

C:\ONGRTLNS.W95


Haut
Profil Citer
Luminoir
Sujet du message : Re: MS-DOS: MUF Volume 1 n°7 [en]
Publié : 08 sept. 2014 06:57
 
 
Your archive has problems, I cannot extract it


Haut
Citer
gm86
Sujet du message : Re: MS-DOS: MUF Volume 1 n°7 [en]
Publié : 18 sept. 2014 19:50
Membre inscrit
Avatar de l’utilisateur
Hors-ligne
 
Messages : 500
Inscription : 01 sept. 2008 19:07
 
I've the original file, plus the 6th version: temporary link

Big Monstro's moderator answer: Thank you gm86 ! The archive is now uploaded on our server ^_^

_________________

C:\ONGRTLNS.W95


Haut
Profil
Afficher : Trier par : Ordre :
Répondre   Page 1 sur 1  [ 6 messages ]
Revenir à « Resources »
Aller :