home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR3 / MUF.ZIP / MUF.TXT
Text File  |  1993-09-20  |  21KB  |  577 lines

  1.  
  2.                                  The
  3.                                Fabulous
  4.  
  5.        ####       ####        ###    ###         ##########
  6.        #####     #####        ###    ###         ##########
  7.        ### ##   ## ###        ###    ###         ###
  8.        ###  ## ##  ###        ###    ###         ########
  9.        ###   ###   ###        ###    ###         ########
  10.        ###    #    ###        ###    ###         ###
  11.        ###         ###        ###    ###         ###
  12.        ###         ###  ##    ##########   ##    ###     ##
  13.        ###         ###  ##     ########    ##    ###     ##
  14.  
  15.                                  List
  16.  
  17.                   (MicroSoft's Undocumented Features)
  18.  
  19.                           Volume 1  Number 5
  20. ===============================================================================
  21.  
  22. 1)   TRUENAME
  23.  
  24.      Internal DOS 5.0 command.  Canonicalize a filename or path (using
  25.      DOS interrupt 21h, function 60) prints the actual directory.
  26.  
  27.      SYNTAX
  28.  
  29.      TRUENAME filename      prints the complete path to file
  30.  
  31.      TRUENAME directory     prints the complete path to directory
  32.  
  33.      Note: If the path is in a network, it starts with a \\machine-name
  34.                                   Michael Larsson
  35.  
  36.  
  37.      TRUENAME is analogous to the "whence" command in the UNIX Korn
  38.      shell.  It returns the real fully qualified pathname for a command.
  39.  
  40.      TRUENAME is useful in networks, where a physical drive may be mapped
  41.      to a logical volume, and the user needs to know the physical location
  42.      of the file.  It ignores the DOS SUBST, and JOIN commands, or network
  43.      MAPped drives.
  44.  
  45.      It is an undocumented MS/DOS feature, but is documented in 4DOS as
  46.      follows:
  47.  
  48.      SYNTAX        (Internal DOS 5.0 / 4DOS)
  49.  
  50.      TRUENAME [d:][path]filename
  51.  
  52.      PURPOSE
  53.  
  54.      Returns a fully qualified filename.
  55.  
  56.      COMMENTS
  57.  
  58.      TRUENAME will see "through" JOIN and SUBST commands, and requires
  59.      MS-DOS 3.0 or above.
  60.  
  61.      EXAMPLE
  62.  
  63.      The following command uses TRUENAME to get the true pathname for a
  64.      file:
  65.  
  66.      c:\> subst d: c:\util\test
  67.      c:\> truename d:\test.exe
  68.  
  69.      c:\util\test\test.exe
  70.                                   Dennis McCunney
  71.  
  72.  
  73.      TRUENAME : will reveal the full name drive and path of the filename.
  74.      If you specify a wildcard ('*') in the filename, it will expand
  75.      the filename to use question marks instead. If the path includes
  76.      the ..\ sequence, TRUENAME will examine the directory structure and
  77.      calculate the path.  Stranger still, the line:
  78.  
  79.          TRUENAME \CRONK\FLIBBET\..\ART
  80.          produces the response:
  81.          C:\CRONK\ART
  82.  
  83.      even if the directories \CRONK\FLIBBET and the file ART don't exist!
  84.      Don't expect this command to work across networks.
  85.                                   PC Magazine #212 Pg. 48-49
  86.                                   Forwarded by:
  87.                                   Rodney Atkins
  88.  
  89.  
  90.  
  91. 2)   FDISK /STATUS ?
  92.      Prints a screen just like using option 4 of fdisk "Partition
  93.      information", but includes extended partition information.
  94.      Nice if you want to get an overview without fear of pressing
  95.      the wrong keys.
  96.                                   Armin Hanisch
  97.      Doesn't work in Ver 3.30.
  98.                                   Mitch Ames
  99.      FDISK /MBR
  100.      MS-DOS 5.0 FDISK has an undocumented parameter, /MBR, that causes it
  101.      to write the master boot record to the hard disk without altering the
  102.      partition table information. While this feature is not documented, it
  103.      can be told to customers on a need-to-know basis.
  104.  
  105.      Warning: Writing the master boot record to the hard disk in this
  106.      manner can make certain hard disks partitioned with SpeedStor
  107.      unusable. It can also cause problems for some dual-boot programs, or
  108.      for disks with more than 4 partitions.  Specific information is below.
  109.  
  110.      What is the MBR?
  111.      At the end of the ROM BIOS bootstrap routine, the BIOS will read and
  112.      execute the first physical sector of the first floppy or hard drive on
  113.      the system. This first sector of the hard disk is called the master
  114.      boot record, or sometimes the partition table or master boot block. At
  115.      the beginning of this sector of the hard disk is a small program. At
  116.      the end of this sector is where the partition information, or
  117.      partition table, is stored. This program uses the partition
  118.      information to determine which partition is bootable (usually the
  119.      first primary DOS partition) and attempts to boot from it.
  120.  
  121.      This program is what is written to the disk by FDISK /MBR and is
  122.      usually called the master boot record.  During normal operation, FDISK
  123.      only writes this program to the disk if there is no master boot
  124.      record.
  125.  
  126.      Why is the MBR changed during Setup?
  127.      During installation of Microsoft MS-DOS 5 Upgrade, Setup will replace
  128.      the master boot record on the hard disk with code to display the
  129.      message:
  130.  
  131.         The MS-DOS 5.0 Setup was not completed.
  132.         Insert the UNINSTALL #1 diskette in drive A.
  133.         Press the ENTER key to continue.
  134.  
  135.      This message should be erased and the master boot code rewritten
  136.      before Setup is completed. If a problem occurs during Setup and you
  137.      return to the previous MS-DOS, UNINSTAL should also remove this
  138.      message. However, should Setup or UNINSTAL fail to remove this
  139.      message, or should the master boot record become corrupted, a new
  140.      master boot record can be written to the disk using the following
  141.      command:
  142.                    C:\>fdisk /mbr
  143.  
  144.      WARNINGS:
  145.      This option should not be used if:
  146.  
  147.         - the disk was partitioned using Storage Dimensions' SpeedStor
  148.           utility with its /Bootall option
  149.         - more than 4 partitions exist
  150.         - certain dual-boot programs are in use
  151.  
  152.      Storage Dimensions' SpeedStor utility using the /Bootall option
  153.      redefines the drive's physical parameters (cylinder, head, sector).
  154.      /BOOTALL stores information on how the drive has been changed in an
  155.      area of the master boot record that MS-DOS does not use. FDISK /MBR
  156.      will erase that information, making the disk unusable.
  157.  
  158.      Some older OEM versions of MS-DOS and some third-party partitioning
  159.      utilities can create more than 4 partitions.  Additional partition
  160.      information is commonly stored information on partitions in an area
  161.      that FDISK /MBR will overwrite.
  162.  
  163.      Some dual-boot programs have a special MBR that asks the user which
  164.      operating system they want on bootup.  FDISK /MBR erases this program.
  165.      Dual-boot systems that boot whichever partition is marked Active are
  166.      not affected by FDISK /MBR.
  167.                                   MicroSoft Publication
  168.                                   forwarded by Don Dean
  169.  
  170. If you have a Boot Sector Virus, just boot from a known "clean" floppy
  171. disk (which has the System files and FDISK on it - IE: your "disaster
  172. recovery disk") and run FDISK /MBR.  Bye, Bye Virus!
  173.                                   Gary Cooper
  174.      Make sure it's write protected ..
  175.                                   Jasen Betts
  176.  
  177.  
  178.  
  179. 3)   SHELL=C:\COMMAND.COM /E:1024 /F /P
  180.  
  181.      The /F in your Config.sys SHELL= statement is another undocumented
  182.      feature.
  183.  
  184.      It forces a "Fail" response to the "Abort, Retry, Fail" prompt issued
  185.      by the DOS critical error handler.
  186.  
  187.  
  188.                                   Dennis McCunney
  189.  
  190.      COMMAND /F
  191.  
  192.      Makes all those annoying "Abort, Retry, Ignore, Fail?"
  193.      disk error messages default to "Fail".
  194.  
  195.                                   Erik Ratcliffe
  196.  
  197.      For DOS 3.30 (somebody might care to check these for other versions):
  198.  
  199.      COMMAND /P
  200.  
  201.         Docs say that this doesn't allow you to exit back to the
  202.         previous shell (ie /Permanent), but /P also forces
  203.         \autoexec.bat to be run on secondary shells.
  204.  
  205.      COMMAND /D
  206.  
  207.         (When used with a primary shell, or secondary with /P)
  208.         prevents execution of \autoexec.bat
  209.  
  210.  
  211.  
  212.                                  Mitch Ames
  213.  
  214.  
  215. 4)   VER/R
  216.  
  217.      Yields extended information about the OS Version.  IE:
  218.  
  219.      MS-DOS Version 5.00
  220.      Revision A
  221.      DOS is in HMA
  222.  
  223.                                   Billy Gilbreath
  224.  
  225.  
  226.      Doesn't work with DOS 3.30
  227.  
  228.                                   Mitch Ames
  229.  
  230.  
  231. 5)   ECHO OFF     from the command line erases the prompt and leaves
  232.                   just a cursor on the screen.
  233.  
  234.      ECHO ON      from the command line restores the prompt.
  235.  
  236.      This works with all version of DOS (tested so far!).
  237.  
  238.                                   Michael Larsson
  239.  
  240. Editor's Note:
  241.  
  242.      One of the most frequently asked questions in the BatPower echo
  243.      is "How do I ECHO a blank line?"  The most common answer is "ECHO."
  244.      However, I have captured a few posts which expand on the
  245.      possibile answers to this request:
  246.  
  247.      ECHO"
  248.  
  249.                                   Paul Welsh
  250.  
  251.     just about any white space character will work.
  252.  
  253.                                   Alan Newbery
  254.  
  255.     I just found out myself that any delimiter will work here
  256.     (ECHO. ECHO" ECHO, ECHO: ECHO; ECHO[ ECHO] etc.).  Apparently
  257.     it's just the way that the command handles the delimiter and
  258.     has been available from way back.  Microsoft just began
  259.     mentioning it in the documentation recently, though, and their
  260.     examples use a period.
  261.                                   John Whitfield
  262.  
  263.  
  264. 6)   FORMAT A: /AUTOTEST
  265.      The autotest parameter will allow format to proceed, checking
  266.      existing format (unless the /u parameter is also present) and
  267.      proceeding with the format.
  268.  
  269.      All this will take place with no delay and no waiting for user
  270.      input.  It will also end without pausing.  It will not ask for
  271.      a volume label or whether to format another diskette.
  272.  
  273.      WARNING!  This procedure will also work on hard drives!  Be very
  274.      cautious if you plan to use this feature.
  275.                                   Wayne Woodman
  276.  
  277.      FORMAT/U is not available in DOS 3.30
  278.                                   Mitch Ames
  279.  
  280.      FORMAT C: /BACKUP
  281.      This week I've read some articles in Dutch computer magazines about MUF's
  282.      which are very interesting (if you don't already know about them).
  283.  
  284.      I already knew the FORMAT option /AUTOTEST, but new to me was the
  285.      /BACKUP option.
  286.  
  287.      EXAMPLE: FORMAT A: /BACKUP
  288.  
  289.      It seems to work exactly like /AUTOTEST, but it DOES ask for a volume
  290.      label.
  291.                                   Willem Van.den.broek
  292.  
  293.      FORMAT/SELECT
  294.      is like DOS-Mirror  ... for safety-fanatics only
  295.  
  296.      FORMAT/SELECT/U
  297.      makes disks unreadable (remember the U)
  298.                                   Reinhard Kujawa
  299.                        Info from The German magazine PC PRAXIS
  300.  
  301.      FORMAT /H
  302.      In DOS 3.30 (I don't know about other versions), FORMAT /H
  303.      will cause the format to begin immediately after pressing Y
  304.      in response to "Format another?", rather than displaying
  305.      "Place disk to be formatted in drive A: and press Enter" on
  306.      a second and subsequent disks.
  307.                                   Mitch Ames
  308.  
  309.      On 5.0 it comes back as "invalid switch".
  310.                                   John Mudge
  311.  
  312.  
  313. 7)   IF EXIST
  314.  
  315.      IE: IF EXIST EMMXXXX0 GOTO APPLICATION
  316.  
  317.      This is a handy quirk of DOS - installable drivers are seen as files
  318.      in all directories.  You can use the if exist test to either test for
  319.      the existance of a directory, with "if exist <dirname>\nul", (which
  320.      fails if the directory does not exist because the nul device is not
  321.      found,) or to test whether a driver is loaded.
  322.  
  323.      Caveats:  you need to know the name of the directory or the driver
  324.      whose existance you are testing, and this is MS/DOS specific - it
  325.      doesn't work on network drives, and may not work under DR-DOS.
  326.                                 Gary Marden
  327.  
  328.  
  329.      This works definitely under DRDOS:
  330.                DR DOS Version 6.0
  331.                Copyright (c) 1976,1982,1988,1990,1991 Digital Research Inc.
  332.                Alle Rechte vorbehalten.
  333.  
  334.                C:\>if exist emmxxxx0 echo ja
  335.                ja
  336.                                 Wolfram Serber
  337.  
  338.      Where did you learn the "EMMXXXX0" name from?
  339.  
  340.      Instead of typing MEM /C, type MEM /D for the "debug" listing.
  341.      That should give the names you're looking for.
  342.                                 Erik Ratcliffe
  343.  
  344.      The trouble is, EXISTS returns TRUE for COM3/4 and LPT2/3 even
  345.      though the hardware does not exist.
  346.                                 Rudy Lacchin
  347.  
  348.  
  349. 8)   ATTRIB
  350.  
  351.      Is there anyway to create a hidden directory on a hard drive?
  352.  
  353.      I've since learned that DOS 5.0 ATTRIB can do the same thing
  354.      from the command line:  ATTRIB +h dirname.
  355.  
  356.                                  Gary Smith
  357.  
  358.  
  359. 9)   SWITCHES=/W
  360.  
  361.      Enables you to have your WINA20 file anywhere on your boot
  362.      drive.  Without this you have to have it in the root directory.
  363.  
  364.                                  Erik Ratcliffe
  365.  
  366.       You should also mention that this one should not be used with
  367.       Windows 3.1. I've noticed a lot of people who do, and it wastes
  368.       around 120K of UMBs.
  369.  
  370.                                 George Hannah
  371.  
  372.  
  373. 10)  FOR %%V IN /SOMETHING
  374.  
  375.      ... quoting Dirk Treusch to All ...
  376.  
  377.       How can a batch file (without 4DOS) determine from which drive it has
  378.       been started?
  379.  
  380.       Example: C:\> a:test.bat
  381.  
  382.       Now my batch should be able to find out that it is located on drive A:
  383.       (not the path - only drive!).
  384.  
  385.       Mitch Ames responds:
  386.  
  387.       The variable %0 contains the name of the batch file
  388.       _as_it_was_typed_at_the_command_line.  If you call the batch file as
  389.       A:TEST.BAT, %0 will be "A:TEST.BAT".  If you have the directory on
  390.       your path, and simply type TEST, then %0 will be "TEST".  The drive,
  391.       path and extension will only appear in %0 if you enter them in the
  392.       command used to call the batch file (either typed at the command
  393.       line, or called from another batch file).
  394.  
  395.       So you _must_ specify the drive as part of the batch filename for
  396.       this to work.  To extract the drive only, use STRINGS, or similar (I
  397.       don't have a copy, so don't ask me to post it).  Alternatively use
  398.       the undocumented FOR %%V in /SOMETHING command, eg:
  399.  
  400.              set drive=
  401.              for %%v in (/%0) do call test2 %%v
  402.              echo Calling drive is %drive%
  403.  
  404.        where TEST2.BAT is:
  405.  
  406.              if not '%drive%'=='' set drive=%1:
  407.  
  408.        Disclaimer - I haven't tested this.  Debugging is up to you.
  409.  
  410.        (You can, of course, fit this into a single recursive batch file -
  411.        but that's left as an exercise for the student.)
  412.  
  413.        FOR %%V IN (/SOMETHING) DO WHATEVER will do WHATEVER twice - the
  414.        first time with %%V set to the first character in SOMETHING ("S"),
  415.        the second time with all the remaining characters in SOMETHING
  416.        ("OMETHING").  If SOMETHING is only a single character, WHATEVER will
  417.        only be called once, with that character in %%V.  If the single
  418.        character is a wildcard (? or *) that wild card will _not_ be
  419.        expanded to a set of filenames.  (The main purpose of this feature is
  420.        apparently to allow inclusion of the literal characters "?" and "*"
  421.        without them being expanded.)
  422.  
  423.        This works in DOS 3.30 and 5 - I don't know about other versions.
  424.  
  425.                                 Mitch Ames
  426.  
  427.  
  428. 11)    DIR,
  429.  
  430.        Using a comma IMMEDIATELY after DIR, shows ALL files, including
  431.        the HIDDEN ones.
  432.  
  433.        EXAMPLE: DIR,
  434.  
  435.                                 Willem van den Broek
  436.  
  437.  
  438.        This appears only to work with version 5.  I tried it with 3.30, and
  439.        it didn't display either IO.SYS, MSDOS.SYS (both with S, H and R
  440.        attribs) or a test file with A and H attribs.
  441.  
  442.        With version 5 it displayed the test file with H and A, but would not
  443.        display IO.SYS or MSDOS.SYS with S, H and R.  This doesn't suprise me
  444.        actually, since S alone (without H) will prevent inclusion of a file
  445.        in a normal DIR.
  446.  
  447.        I didn't try version 4.
  448.  
  449.                                 Mitch Ames
  450.  
  451.  
  452.        Interesting: it (DOS5 display IO.SYS and MSDOS.SYS) does for me:
  453.  
  454.        However, 4DOS does not do it:
  455.  
  456.                                 Dennis Mccunney
  457.  
  458.  
  459. 12)    DIR..
  460.  
  461.        With DOS 6.0 you can get a directory of -all- files (hidden,
  462.        system, etc.) with this command.
  463.  
  464.        It was in a PC/Mag. or PC/Comp. issue not too long ago.
  465.  
  466.                                 Andrew Barnhardt
  467.  
  468.  
  469. 13)    COPY. A:
  470.  
  471.        The use of a decimal point IMMEDIATELY after some DOS statements,
  472.        will replace *.*
  473.  
  474.        EXAMPLES: DEL.       (erase all files in current directory)
  475.                  COPY. A:   (copy all files in current directory to A:)
  476.  
  477.        There may be more statements with which it works, but I haven't
  478.        tried them yet.
  479.                                 Willem van den Broek
  480.  
  481. Editor's Note:
  482.        I admit that this is a documented (although obscure feature), the
  483.        reason that it continues to be seen in the MUF list is because
  484.        I believe that the ability to use the period immediately IE: COPY.
  485.        is not documented.  What is documented is the fact that "." and
  486.        ".." can be used to represent the current and parent directories
  487.        respectively, and these will work with many applications which
  488.        can handle directory names as arguements.  In this case the "."
  489.        could also be viewed as a replacement for "*.*"
  490.  
  491.  
  492. 14)    DOS?=HIGH
  493.  
  494.        Try "DOS?=HIGH" (with DOS 6.0) and it'll prompt you whether to
  495.        load DOS high or not.
  496.                                   Yousuf Khan
  497.  
  498.  
  499. 15)    INSTALLHIGH
  500.  
  501.        I think I may have found an undocumented feature for DOS 6....
  502.        I wasn't able to find this anywhere in the online help.  It's
  503.        called INSTALLHIGH= and amazingly enough it works just like
  504.        INSTALL= but loads the file high!
  505.  
  506.        The only drawback to this is: Memmaker will not go through and
  507.        add switches for that particular line during the "optimizing
  508.        process".  It just takes it as it is currently.  But then again
  509.        INSTALL= is ignored too!
  510.  
  511.        Example:
  512.        DEVICE=C:\DOS\HIMEM.SYS
  513.        DEVICE=C:\DOS\EMM386.EXE NOEMS HIGHSCAN WIN=F500-F7FF WIN=F200-F4FF
  514.        dos=HIGH
  515.        dos=UMB
  516.        installhigh=c:\dos\share.exe
  517.                                Robin Francis
  518.  
  519.  
  520. 16)    : (command)
  521.  
  522.        DOS uses a leading : to indicate a label.  If the next character
  523.        following the : is a space or other non-alphanumeric char, DOS
  524.        will decide it's an invalid label and skip to the next line,
  525.        performing no further action.
  526.                                 Dennis Mccunney
  527.  
  528.  
  529. 17)    Delimiting Character:
  530.  
  531.        Prior to DOS 5.0, there was an undocumented DOS function that
  532.        would allow you to set the DOS option delimiter character to
  533.        something else, like -.  Once you did this, you could use either
  534.        \ *or* / in PATH specs.
  535.  
  536.        DOS 5.0 removed the function to *set* the option delimiter, but
  537.        *retained* the one to query what it currently is!  (Don't ask me,
  538.        ask M'Soft...)  Fortunately, the MKS Toolkit still works with no
  539.        apparent glitches.
  540.  
  541.        I believe in pre-DOS 3.X versions that there was a parm you could
  542.        provide in CONFIG.SYS to do this, but have no further details.
  543.  
  544.        Just remember: "undocumented" is a synonym for "unsupported, and
  545.        not guaranteed to be there next release", which is what happened
  546.        in the case I mentioned above.
  547.                                    Dennis Mccunney
  548.  
  549.  
  550. 18)   REM IN LINES WITH PIPES OR REDIRECTS
  551.  
  552.       ie:    REM echo y | del *.*
  553.  
  554.       Michael Serber reported that he encountered problems when
  555.       he tried to REM out an "echo y|del *.*" line in his batch
  556.       file.  Here is the content of some of the responses he
  557.       received in response to his question asking why he experienced
  558.       the problem:
  559.  
  560.       It (the problem) appears to only occur if there is a pipe or
  561.       redirection in the line (REM'd out), leading me to believe that
  562.       DOS first handles pipes and redirections, then goes back to
  563.       find out what to do with them.
  564.                               John Mudge
  565.  
  566.      It's actually doing what it thinks you've told it: piping the
  567.      output of REM to DEL.  Since REM _has_ no output (remember
  568.      REM > NULLFILE?), DEL hangs, waiting for the answer to its
  569.      question.
  570.                               Gary Smith
  571.  
  572.      What is happening here is that DOS reads the entire line, and
  573.      always processes redirection and piping *first*, regardless of
  574.      where they happen to appear.
  575.                               Dennis Mccunney
  576.  
  577.