Skip to content

Instantly share code, notes, and snippets.

@davidruhmann
Created January 16, 2013 02:42
Show Gist options
  • Save davidruhmann/4544203 to your computer and use it in GitHub Desktop.
Save davidruhmann/4544203 to your computer and use it in GitHub Desktop.
Microsoft Undocumented Features Version 15
===========================================================================
Date: 07-16-93 (23:51) Number: 9499
From: BEN DAVIS Refer#: NONE
To: ALL Recvd: NO
Subj: The MUF List follows... Conf: DOS6
---------------------------------------------------------------------------
ÿ@ORIGIN :EXECNET N
Hi,
I've decided to post this list here, due to a few begging messages. I
suppose it should be in DOS_TIPS, but there was a lot of interest before
when I mentioned the TRUENAME command. The collator of the MUF list is
Gary Cooper, who can be found in the worldwide Fidonet BATPOWER echo.
I would appreciate it if you guys out there could check whether these
'features (?)' work in DOS 6, and if so, whether they are documented.
Leave replies here; it is *very* important that you check the DOS 6
manual _thoroughly_ for reference to these commands/features before
saying they are undocumented, as neither Gary nor me has a DOS 6 manual
(we're skint <g>). Oh, and feel free to export these messages into a
file and post them on your local BBS under the name
MUF15.TXT/ZIP/ARJ/ARC/whatever. I await your replies.
CIAO,
Ben Davis
Manchester, Olympic City 2000!
ben.davis@p115.f107.n250.z2.fidouk.fidonet.org
---
* OFFLINE 1.54 * If you haven't been to Manchester you haven't lived.
þ QNet3á þ ILink: SysteM-C-V þ Horsham, Sussex þ U.K. þ +44 (0) 403 250607
===========================================================================
The
Fabulous
#### #### ### ### ##########
##### ##### ### ### ##########
### ## ## ### ### ### ###
### ## ## ### ### ### ########
### ### ### ### ### ########
### # ### ### ### ###
### ### ### ### ###
### ### ## ########## ## ### ##
### ### ## ######## ## ### ##
List
(MicroSoft's Undocumented Features)
Volume 1 Number 5
===============================================================================
1) TRUENAME
Internal DOS 5.0 command. Canonicalize a filename or path (using
DOS interrupt 21h, function 60) prints the actual directory.
SYNTAX
TRUENAME filename prints the complete path to file
TRUENAME directory prints the complete path to directory
Note: If the path is in a network, it starts with a \\machine-name
Michael Larsson
TRUENAME is analogous to the "whence" command in the UNIX Korn
shell. It returns the real fully qualified pathname for a command.
TRUENAME is useful in networks, where a physical drive may be mapped
to a logical volume, and the user needs to know the physical location
of the file. It ignores the DOS SUBST, and JOIN commands, or network
MAPped drives.
It is an undocumented MS/DOS feature, but is documented in 4DOS as
follows:
SYNTAX (Internal DOS 5.0 / 4DOS)
TRUENAME [d:][path]filename
PURPOSE
Returns a fully qualified filename.
COMMENTS
TRUENAME will see "through" JOIN and SUBST commands, and requires
MS-DOS 3.0 or above.
EXAMPLE
The following command uses TRUENAME to get the true pathname for a
file:
c:\> subst d: c:\util\test
c:\> truename d:\test.exe
c:\util\test\test.exe
Dennis McCunney
TRUENAME : will reveal the full name drive and path of the filename.
If you specify a wildcard ('*') in the filename, it will expand
the filename to use question marks instead. If the path includes
the ..\ sequence, TRUENAME will examine the directory structure and
calculate the path. Stranger still, the line:
TRUENAME \CRONK\FLIBBET\..\ART
produces the response:
C:\CRONK\ART
even if the directories \CRONK\FLIBBET and the file ART don't exist!
Don't expect this command to work across networks.
PC Magazine #212 Pg. 48-49
Forwarded by:
Rodney Atkins
===============================================================================
2) FDISK /STATUS ?
Prints a screen just like using option 4 of fdisk "Partition
information", but includes extended partition information.
Nice if you want to get an overview without fear of pressing
the wrong keys.
Armin Hanisch
Doesn't work in Ver 3.30.
Mitch Ames
FDISK /MBR
MS-DOS 5.0 FDISK has an undocumented parameter, /MBR, that causes it
to write the master boot record to the hard disk without altering the
partition table information. While this feature is not documented, it
can be told to customers on a need-to-know basis.
Warning: Writing the master boot record to the hard disk in this
manner can make certain hard disks partitioned with SpeedStor
unusable. It can also cause problems for some dual-boot programs, or
for disks with more than 4 partitions. Specific information is below.
What is the MBR?
At the end of the ROM BIOS bootstrap routine, the BIOS will read and
execute the first physical sector of the first floppy or hard drive on
the system. This first sector of the hard disk is called the master
boot record, or sometimes the partition table or master boot block. At
the beginning of this sector of the hard disk is a small program. At
the end of this sector is where the partition information, or
partition table, is stored. This program uses the partition
information to determine which partition is bootable (usually the
first primary DOS partition) and attempts to boot from it.
This program is what is written to the disk by FDISK /MBR and is
usually called the master boot record. During normal operation, FDISK
only writes this program to the disk if there is no master boot
record.
Why is the MBR changed during Setup?
During installation of Microsoft MS-DOS 5 Upgrade, Setup will replace
the master boot record on the hard disk with code to display the
message:
The MS-DOS 5.0 Setup was not completed.
Insert the UNINSTALL #1 diskette in drive A.
Press the ENTER key to continue.
This message should be erased and the master boot code rewritten
before Setup is completed. If a problem occurs during Setup and you
return to the previous MS-DOS, UNINSTAL should also remove this
message. However, should Setup or UNINSTAL fail to remove this
message, or should the master boot record become corrupted, a new
master boot record can be written to the disk using the following
command:
C:\>fdisk /mbr
WARNINGS:
This option should not be used if:
- the disk was partitioned using Storage Dimensions' SpeedStor
utility with its /Bootall option
- more than 4 partitions exist
- certain dual-boot programs are in use
Storage Dimensions' SpeedStor utility using the /Bootall option
redefines the drive's physical parameters (cylinder, head, sector).
/BOOTALL stores information on how the drive has been changed in an
area of the master boot record that MS-DOS does not use. FDISK /MBR
will erase that information, making the disk unusable.
Some older OEM versions of MS-DOS and some third-party partitioning
utilities can create more than 4 partitions. Additional partition
information is commonly stored information on partitions in an area
that FDISK /MBR will overwrite.
Some dual-boot programs have a special MBR that asks the user which
operating system they want on bootup. FDISK /MBR erases this program.
Dual-boot systems that boot whichever partition is marked Active are
not affected by FDISK /MBR.
MicroSoft Publication
forwarded by Don Dean
If you have a Boot Sector Virus, just boot from a known "clean" floppy
disk (which has the System files and FDISK on it - IE: your "disaster
recovery disk") and run FDISK /MBR. Bye, Bye Virus!
Gary Cooper
Make sure it's write protected ..
Jasen Betts
===============================================================================
3) SHELL=C:\COMMAND.COM /E:1024 /F /P
The /F in your Config.sys SHELL= statement is another undocumented
feature.
It forces a "Fail" response to the "Abort, Retry, Fail" prompt issued
by the DOS critical error handler.
Dennis McCunney
COMMAND /F
Makes all those annoying "Abort, Retry, Ignore, Fail?"
disk error messages default to "Fail".
Erik Ratcliffe
For DOS 3.30 (somebody might care to check these for other versions):
COMMAND /P
Docs say that this doesn't allow you to exit back to the
previous shell (ie /Permanent), but /P also forces
\autoexec.bat to be run on secondary shells.
COMMAND /D
(When used with a primary shell, or secondary with /P)
prevents execution of \autoexec.bat
Mitch Ames
===============================================================================
4) VER/R
Yields extended information about the OS Version. IE:
MS-DOS Version 5.00
Revision A
DOS is in HMA
Billy Gilbreath
Doesn't work with DOS 3.30
Mitch Ames
===============================================================================
5) ECHO OFF from the command line erases the prompt and leaves
just a cursor on the screen.
ECHO ON from the command line restores the prompt.
This works with all version of DOS (tested so far!).
Michael Larsson
Editor's Note:
One of the most frequently asked questions in the BatPower echo
is "How do I ECHO a blank line?" The most common answer is "ECHO."
However, I have captured a few posts which expand on the
possibile answers to this request:
ECHO"
Paul Welsh
just about any white space character will work.
Alan Newbery
I just found out myself that any delimiter will work here
(ECHO. ECHO" ECHO, ECHO: ECHO; ECHO[ ECHO] etc.). Apparently
it's just the way that the command handles the delimiter and
has been available from way back. Microsoft just began
mentioning it in the documentation recently, though, and their
examples use a period.
John Whitfield
===============================================================================
6) FORMAT A: /AUTOTEST
The autotest parameter will allow format to proceed, checking
existing format (unless the /u parameter is also present) and
proceeding with the format.
All this will take place with no delay and no waiting for user
input. It will also end without pausing. It will not ask for
a volume label or whether to format another diskette.
WARNING! This procedure will also work on hard drives! Be very
cautious if you plan to use this feature.
Wayne Woodman
FORMAT/U is not available in DOS 3.30
Mitch Ames
FORMAT C: /BACKUP
This week I've read some articles in Dutch computer magazines about MUF's
which are very interesting (if you don't already know about them).
I already knew the FORMAT option /AUTOTEST, but new to me was the
/BACKUP option.
EXAMPLE: FORMAT A: /BACKUP
It seems to work exactly like /AUTOTEST, but it DOES ask for a volume
label.
Willem Van.den.broek
FORMAT/SELECT
is like DOS-Mirror ... for safety-fanatics only
FORMAT/SELECT/U
makes disks unreadable (remember the U)
Reinhard Kujawa
Info from The German magazine PC PRAXIS
FORMAT /H
In DOS 3.30 (I don't know about other versions), FORMAT /H
will cause the format to begin immediately after pressing Y
in response to "Format another?", rather than displaying
"Place disk to be formatted in drive A: and press Enter" on
a second and subsequent disks.
Mitch Ames
On 5.0 it comes back as "invalid switch".
John Mudge
===============================================================================
7) IF EXIST
IE: IF EXIST EMMXXXX0 GOTO APPLICATION
This is a handy quirk of DOS - installable drivers are seen as files
in all directories. You can use the if exist test to either test for
the existance of a directory, with "if exist <dirname>\nul", (which
fails if the directory does not exist because the nul device is not
found,) or to test whether a driver is loaded.
Caveats: you need to know the name of the directory or the driver
whose existance you are testing, and this is MS/DOS specific - it
doesn't work on network drives, and may not work under DR-DOS.
Gary Marden
This works definitely under DRDOS:
DR DOS Version 6.0
Copyright (c) 1976,1982,1988,1990,1991 Digital Research Inc.
Alle Rechte vorbehalten.
C:\>if exist emmxxxx0 echo ja
ja
Wolfram Serber
Where did you learn the "EMMXXXX0" name from?
Instead of typing MEM /C, type MEM /D for the "debug" listing.
That should give the names you're looking for.
Erik Ratcliffe
The trouble is, EXISTS returns TRUE for COM3/4 and LPT2/3 even
though the hardware does not exist.
Rudy Lacchin
===============================================================================
8) ATTRIB
Is there anyway to create a hidden directory on a hard drive?
I've since learned that DOS 5.0 ATTRIB can do the same thing
from the command line: ATTRIB +h dirname.
Gary Smith
===============================================================================
9) SWITCHES=/W
Enables you to have your WINA20 file anywhere on your boot
drive. Without this you have to have it in the root directory.
Erik Ratcliffe
You should also mention that this one should not be used with
Windows 3.1. I've noticed a lot of people who do, and it wastes
around 120K of UMBs.
George Hannah
===============================================================================
10) FOR %%V IN /SOMETHING
... quoting Dirk Treusch to All ...
How can a batch file (without 4DOS) determine from which drive it has
been started?
Example: C:\> a:test.bat
Now my batch should be able to find out that it is located on drive A:
(not the path - only drive!).
Mitch Ames responds:
The variable %0 contains the name of the batch file
_as_it_was_typed_at_the_command_line. If you call the batch file as
A:TEST.BAT, %0 will be "A:TEST.BAT". If you have the directory on
your path, and simply type TEST, then %0 will be "TEST". The drive,
path and extension will only appear in %0 if you enter them in the
command used to call the batch file (either typed at the command
line, or called from another batch file).
So you _must_ specify the drive as part of the batch filename for
this to work. To extract the drive only, use STRINGS, or similar (I
don't have a copy, so don't ask me to post it). Alternatively use
the undocumented FOR %%V in /SOMETHING command, eg:
set drive=
for %%v in (/%0) do call test2 %%v
echo Calling drive is %drive%
where TEST2.BAT is:
if not '%drive%'=='' set drive=%1:
Disclaimer - I haven't tested this. Debugging is up to you.
(You can, of course, fit this into a single recursive batch file -
but that's left as an exercise for the student.)
FOR %%V IN (/SOMETHING) DO WHATEVER will do WHATEVER twice - the
first time with %%V set to the first character in SOMETHING ("S"),
the second time with all the remaining characters in SOMETHING
("OMETHING"). If SOMETHING is only a single character, WHATEVER will
only be called once, with that character in %%V. If the single
character is a wildcard (? or *) that wild card will _not_ be
expanded to a set of filenames. (The main purpose of this feature is
apparently to allow inclusion of the literal characters "?" and "*"
without them being expanded.)
This works in DOS 3.30 and 5 - I don't know about other versions.
Mitch Ames
===============================================================================
11) DIR,
Using a comma IMMEDIATELY after DIR, shows ALL files, including
the HIDDEN ones.
EXAMPLE: DIR,
Willem van den Broek
This appears only to work with version 5. I tried it with 3.30, and
it didn't display either IO.SYS, MSDOS.SYS (both with S, H and R
attribs) or a test file with A and H attribs.
With version 5 it displayed the test file with H and A, but would not
display IO.SYS or MSDOS.SYS with S, H and R. This doesn't suprise me
actually, since S alone (without H) will prevent inclusion of a file
in a normal DIR.
I didn't try version 4.
Mitch Ames
Interesting: it (DOS5 display IO.SYS and MSDOS.SYS) does for me:
However, 4DOS does not do it:
Dennis Mccunney
===============================================================================
12) DIR..
With DOS 6.0 you can get a directory of -all- files (hidden,
system, etc.) with this command.
It was in a PC/Mag. or PC/Comp. issue not too long ago.
Andrew Barnhardt
===============================================================================
13) COPY. A:
The use of a decimal point IMMEDIATELY after some DOS statements,
will replace *.*
EXAMPLES: DEL. (erase all files in current directory)
COPY. A: (copy all files in current directory to A:)
There may be more statements with which it works, but I haven't
tried them yet.
Willem van den Broek
Editor's Note:
I admit that this is a documented (although obscure feature), the
reason that it continues to be seen in the MUF list is because
I believe that the ability to use the period immediately IE: COPY.
is not documented. What is documented is the fact that "." and
".." can be used to represent the current and parent directories
respectively, and these will work with many applications which
can handle directory names as arguements. In this case the "."
could also be viewed as a replacement for "*.*"
===============================================================================
14) DOS?=HIGH
Try "DOS?=HIGH" (with DOS 6.0) and it'll prompt you whether to
load DOS high or not.
Yousuf Khan
===============================================================================
15) INSTALLHIGH
I think I may have found an undocumented feature for DOS 6....
I wasn't able to find this anywhere in the online help. It's
called INSTALLHIGH= and amazingly enough it works just like
INSTALL= but loads the file high!
The only drawback to this is: Memmaker will not go through and
add switches for that particular line during the "optimizing
process". It just takes it as it is currently. But then again
INSTALL= is ignored too!
Example:
DEVICE=C:\DOS\HIMEM.SYS
DEVICE=C:\DOS\EMM386.EXE NOEMS HIGHSCAN WIN=F500-F7FF WIN=F200-F4FF
dos=HIGH
dos=UMB
installhigh=c:\dos\share.exe
Robin Francis
===============================================================================
16) : (command)
DOS uses a leading : to indicate a label. If the next character
following the : is a space or other non-alphanumeric char, DOS
will decide it's an invalid label and skip to the next line,
performing no further action.
Dennis Mccunney
===============================================================================
17) Delimiting Character:
Prior to DOS 5.0, there was an undocumented DOS function that
would allow you to set the DOS option delimiter character to
something else, like -. Once you did this, you could use either
\ *or* / in PATH specs.
DOS 5.0 removed the function to *set* the option delimiter, but
*retained* the one to query what it currently is! (Don't ask me,
ask M'Soft...) Fortunately, the MKS Toolkit still works with no
apparent glitches.
I believe in pre-DOS 3.X versions that there was a parm you could
provide in CONFIG.SYS to do this, but have no further details.
Just remember: "undocumented" is a synonym for "unsupported, and
not guaranteed to be there next release", which is what happened
in the case I mentioned above.
Dennis Mccunney
===============================================================================
18) REM IN LINES WITH PIPES OR REDIRECTS
ie: REM echo y | del *.*
Michael Serber reported that he encountered problems when
he tried to REM out an "echo y|del *.*" line in his batch
file. Here is the content of some of the responses he
received in response to his question asking why he experienced
the problem:
It (the problem) appears to only occur if there is a pipe or
redirection in the line (REM'd out), leading me to believe that
DOS first handles pipes and redirections, then goes back to
find out what to do with them.
John Mudge
It's actually doing what it thinks you've told it: piping the
output of REM to DEL. Since REM _has_ no output (remember
REM > NULLFILE?), DEL hangs, waiting for the answer to its
question.
Gary Smith
What is happening here is that DOS reads the entire line, and
always processes redirection and piping *first*, regardless of
where they happen to appear.
Dennis Mccunney
===============================================================================
Note: normal and expected end of text.
===============================================================================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment