  -170-


  CHAPTER 6 / COMMAND REFERENCE GUIDE


  The following pages are a complete guide and reference to the
  4DOS, 4OS2, and 4NT commands that are available from the command
  line, in aliases, and in batch files.  Most of these commands are
  internal, which means that the command processor performs the
  activity you have requested without running another program.  (See
  page 17 for more information on internal and external commands.)

  We offer over 90 internal commands, many more than any version of
  COMMAND.COM or CMD.EXE.  These neither replace nor interfere with
  external commands like BACKUP, DISKCOPY, SCANDISK, or XCOPY.  You
  can continue to use those utilities like you always have.  Also,
  each of our command processors has been designed to be compatible
  with virtually all traditional internal commands, and to enhance
  most of those commands with additional options and capabilities.
  Once you have installed your new command processor, you can
  continue using the commands that you already know and get the same
  results.

  We have made no attempt to document external DOS, OS/2, and
  Windows NT commands in this reference, partly because they are
  explained in your operating system documentation, and partly
  because external commands -- and the options available with each
  command -- vary widely from one operating system to another and
  from one version to another.  The 4DOS help system can be
  configured to start the DOS help program, if it is available, and
  the 4OS2 help system can be configured to display information
  about OS/2 external commands (see the Introduction and
  Installation Guide for further details).

  Most 4DOS, 4OS2, and 4NT commands are either enhanced traditional
  commands or are entirely new (a few are the same as traditional
  commands).  If you are comfortable using traditional commands, you
  can switch to your new command processor without making any
  changes in your habits.  But you will be missing a lot of the
  power of these enhancements and new commands unless you take a few
  minutes to see what's available here.  Make sure you don't skip a
  section of this reference just because you already know how to use
  a traditional command with the same name.

  If you come across terms or concepts in this chapter that you are
  unsure about, please refer to Chapter 1 / General Concepts, the
  Index, or the Glossary which is part of your online help.


  Command Categories

       The best way to learn the commands is to use them and
       experiment with them.  We urge you to browse through this
       chapter occasionally and look for commands that might help
       simplify your computing life.  The following lists categorize
       the available commands by topic and will help you find the
       ones that you need.  Commands listed below with an asterisk
  -171-

       [*] are not available in all command processors; see the list
       at the end for details.

       System configuration:

          BREAK *        CHCP *         CLS            COLOR
          CTTY *         DATE           DIRHISTORY     FREE
          HISTORY        KEYS *         KEYBD          LH/LOADHIGH*
          LOG            MEMORY         OPTION         PROMPT
          REBOOT         SETDOS         SWAPPING *     TIME
          VER            VERIFY         VOL

       File and directory management:

          ATTRIB         COPY           DEL/ERASE      DESCRIBE
          FFIND          LIST           MOVE           REN/RENAME
          SELECT         TOUCH          TREE           TRUENAME *
          TYPE

       Subdirectory management:

          CD/CHDIR       CDD            DIR            DIRS
          MD/MKDIR       POPD           PUSHD          RD/RMDIR

       Input and output:

          DRAWBOX        DRAWHLINE      DRAWVLINE      ECHO
          ECHOERR        ECHOS          ECHOSERR       INKEY
          INPUT          KEYSTACK *     MSGBOX *       SCREEN
          SCRPUT         TEXT           VSCRPUT

       Batch files and aliases (these commands are primarily for
       batch files and aliases -- some may also be useful at the
       prompt, others work only in batch files; see the individual
       commands for details):

          ALIAS          BEEP           CALL           CANCEL
          DELAY          DO             ENDLOCAL       FOR
          GLOBAL         GOSUB          GOTO           IF
          IFF            LOADBTM        ON             PAUSE
          QUIT           REM            RETURN         SETLOCAL
          SHIFT          SWITCH         TEXT           UNALIAS

       Environment and path:

          DPATH *        ESET           PATH           SET
          UNSET

       Window management:

          ACTIVATE *     TITLE *        WINDOW *

       Other commands:

          ?              DETACH *       EXCEPT         EXIT
          HELP           SHRALIAS       START          TEE
          TIMER          Y
  -172-

     * Some of these commands are not included in one or more of our
       command processors.  Usually a command is left out of a
       product when it is not useful or cannot be implemented in
       that environment (for example, DETACH is related to
       multitasking, and is not available under DOS because DOS does
       not offer multitasking).  The commands that are specific to
       particular products are:

          ACTIVATE....4OS2, 4NT         LH/LOADHIGH ...4DOS
          BREAK.......4DOS, 4NT         MSGBOX  .......4NT
          CHCP........4DOS, 4OS2        SHRALIAS ......4OS2, 4NT
          CTTY........4DOS              SWAPPING ......4DOS
          DETACH......4OS2, 4NT         TITLE .........4OS2, 4NT
          DPATH.......4OS2              TRUENAME ......4DOS, 4NT
          KEYS........4OS2, 4NT         WINDOW ........4OS2, 4NT
          KEYSTACK....4DOS, 4OS2


  How to Use the Command Descriptions

       Each of the internal commands is described in detail on the
       following pages.  The descriptions are arranged
       alphabetically, and each includes examples that will help you
       learn to use the commands.

       Each description begins with the name of the command on the
       left side of the page.  If the command is only available in
       some of our products, those products are listed next to the
       command name, and in the page header.  Commands marked "New"
       on the right side of the page are unique to 4DOS, 4OS2, or
       4NT.  Those marked "Enhanced" are similar to traditional com-
       mands but add new features and options; those marked
       "Compatible" follow the syntax and features of the
       traditional command with the same name.

       The name is followed by a sentence or two that briefly
       describes the command's purpose or major function.  That
       sentence should help you determine quickly whether you have
       found the command you are seeking.

       The next part of each description shows the command's format
       or syntax.  The format line uses certain conventions to
       describe how the command should be entered and to create
       reference points for the text describing the command:

            *  Words in UPPER CASE must be spelled exactly as they
               are shown (although you can type them in either upper
               or lower case, or a combination).  If a word is shown
               partly in upper case (for example BLInk), only the
               upper case portion is required, the rest is optional.

            *  Words shown in italics (for example source or
               filename) are meant to be replaced by other words or
               values.  Each of these words is explained directly
               beneath the format line and discussed in more detail
               in the text.  When the word stands for a file name,
               you can use a simple name like MYFILE.TXT, or include
  -173-

               a drive letter and/or a full path, like
               C:\MYDIR\MYFILE.TXT.

            *  Items followed by an ellipsis (three periods [...])
               may be repeated.  For example, filename ... means you
               may enter one or more file names at this point in the
               command.

            *  Text shown in [square brackets] is optional.  Text
               outside of square brackets must be entered literally
               (if it is capitalized) or replaced by other words or
               values (if it is in italics).

            *  Vertical bars [|] represent a choice; you must pick
               one of the listed options.  For example, this format
               shows that the command may be followed by the word ON
               or the word OFF, but not both:

                 COMMAND [ ON | OFF ]

            *  A slash followed by a letter, like [/X], is an
               "option" or "switch" which controls the effect of a
               command.  Many commands have several switches, and
               you are usually free to use none, one, or several to
               make a command behave as you wish.  If you use a
               single switch, you must precede it with a slash.  If
               you use several switches, in most cases you can put
               them together with one slash or use separate slashes.
               For example, if you wanted to use switches X, Y, and
               Z for a command, you could type them three different
               ways:

                 command /x /y /z
                 command /x/y/z
                 command /xyz

               A few switches, particularly in the DIR, FOR, SELECT,
               and START commands, use two or more characters.  If
               you need to follow a multi-letter switch with another
               switch, the second switch must have its own slash to
               avoid ambiguity.

       Included in the format section is an explanation of each
       replaceable argument and a one or two word explanation of
       each switch.  Many descriptions also list related commands to
       help you find the exact command you want.

       For file handling commands, a section called File Selection
       appears immediately after the format section; it lists the
       file-handling features that the command supports.  The list
       may include mention of extended wildcards (see page 64);
       multiple file names (page 72); include lists (page 73); date,
       time, and size ranges (see page 67); and file exclusion
       ranges (see page 72).

       Next, you'll find a description of the command's usage.  This
       description normally starts with the basic functions of a
  -174-

       command and gradually adds more details.  We've also included
       many examples to help you see the command in action.  In the
       examples, characters in bold type represent input from the
       user.  Characters in normal type represent prompts or
       responses from the command processor, or lines in a batch
       file.

       The last part of each description is a detailed explanation
       of the options or switches available for each command, in
       alphabetical order.  Occasionally, we've included more
       examples in this section to demonstrate how a switch is used
       or how multiple switches interact.

       Most of the commands and their switches have the same use in
       4DOS, 4OS2, and 4NT.  When a command, feature, or switch
       applies to a single product, we mention it specifically in
       the text.  When an entire paragraph applies to one or two
       products, we use marginal text to identify the product(s):

4DOS    marks information that applies only to 4DOS.

4OS2    marks information that applies only to 4OS2.

4NT     marks information that applies only to 4NT.

    !  An exclamation point [!] to the left of a paragraph means
       that paragraph contains a caution or warning you should
       observe when using the feature it discusses.

    ## In the Usage and Options sections you may see the symbol ##.
       This indicates a more in-depth discussion or an advanced
       topic which you can skip if you are new to the command; come
       back to this topic later for more details, or if you're
       having trouble with the command.

       The ## doesn't mean that only advanced users will need the
       information -- you may find it useful even if you're
       relatively new to computers or to our products.  But it does
       mean that you can skip the marked section and still
       understand and use the basic features of the command.  If a
       ## appears before the "Usage" heading, it indicates that the
       entire command is generally used only in unusual situations
       or by more advanced users.

       When you see a ## in the list of options, remember that the
       options are listed alphabetically, so there may be more basic
       options discussed later in the list, after a more complex or
       advanced option marked with ##.  Don't stop reading the
       option list the first time you see the mark.


       Attribute Switches

       Many 4DOS, 4OS2, and 4NT commands have a /A or /A: switch
       which allows you to select files for the command to process
       based on their attributes.  These switches all use the format
       /A[:][-]RHSDA (the colon after /A is optional for DIR, FFIND,
  -175-

       and SELECT, but is required in all other cases).  The
       characters after the /A specify which attributes to select,
       as follows:

            R       Read-only        D    Subdirectory
            H       Hidden           A    Archive
            S       System

       Preceding the attribute character with a hyphen [-] will
       select files that do not have that attribute set.  If no
       attributes are listed at all (e.g., /A:), the command will
       select all files and subdirectories including hidden and
       system files.  If attributes are combined, all the specified
       attributes must match for a file to be selected.  For
       example, /A:RHS will select only those files with all three
       attributes set.

       See page 15 for more information on file attributes.
  -176-

  ?                                                              (New)

  Purpose:     Display a list of internal commands, or prompt for a
               command.

  Format:      ? ["prompt" command]

               prompt:  Prompt text about whether to execute the
               command.
               command:  Command to be executed if user answers Y.

  Usage:       ? has two functions.

               When you use the ? command by itself, it displays a
               list of internal commands.  For help with any
               individual command, see the HELP command.  The ?
               display looks like this (the partial list below is
               for 4DOS; you will see a slightly different list for
               4OS2 or 4NT):

                    c:\> ?
                    ?           ALIAS        ATTRIB      BEEP
                    BREAK       CALL         CANCEL      CASE
                    .....
                    .....
                    UNSET       VER          VERIFY      VOL
                    VSCRPUT     Y

               If you have disabled a command with SETDOS /I, it
               will not appear in the list.

               The second function of ? is to prompt the user before
               executing a specific line in a batch file.  If you
               add a prompt and a command, ? will display the prompt
               followed by "(Y/N)?" and wait for the user's
               response.  If the user presses "Y" or "y", the line
               will be executed.  If the user presses "N" or "n",
               the line will be ignored.

               For example, the following command might be used in a
               batch file:

                    ? "Load the network" call netstart.btm

               When this command is executed, you will see the
               following prompt; if you answer "Y", the CALL command
               will be executed:

                    Load the network (Y/N)?
  -177-

  ACTIVATE      [4OS2, 4NT]                                      (New)

  Purpose:     Activate a window, set its state, or change its
               title.

  Format:      ACTIVATE "window" [MAX | MIN | RESTORE | CLOSE |
               "title" ]

               window:  Current title of window to work with.
               title:  New title for window.

               See also:  START, TITLE, and WINDOW.

  Usage:       Both the current name of the window and the new name,
               if any, must be enclosed in double quotes.  The
               quotes will not appear as part of the title bar text.

               If no options are used, the window named in the
               command will become the active window and be able to
               receive keystrokes and mouse commands.

               The MAX option expands the window to its maximum
               size, the MIN option reduces the window to an icon,
               and the RESTORE option returns the window to its
               default size and location on the desktop.  The CLOSE
               option closes the window and ends the session running
               in the window.

               This example maximizes and then renames the window
               called "4NT":

                    [c:\] activate "4NT" max
                    [c:\] activate "4NT" "Command Prompt"

               You can use wildcards (see page 64) in the window
               name if you only know the first part of the title.
               This is useful with applications that change their
               window title to reflect the file currently in use.

       4OS2    ACTIVATE is often used before KEYSTACK to make sure
               the proper window receives the keystrokes.  ACTIVATE
               works by sending the appropriate messages to the
               named window.  If the window ignores or misinterprets
               the messages, ACTIVATE may not have the effect you
               want.

       4OS2    The title option cannot be used in 4OS2, because OS/2
               does not allow one application to change another
               application's window title.
  -178-

  ALIAS                                                          (New)

  Purpose:     Create new command names that execute one or more
               commands or redefine default options for existing
               commands; assign commands to keystrokes; load or
               display the list of defined alias names.

  Format:      ALIAS [/P /R file...] [name[=][value]]

               file:  One or more files to read for alias
               definitions.
               name:  Name for an alias, or for the key to execute
               the alias.
               value:  Text to be substituted for the alias name.

               /P(ause)                 /R(ead file)

               See also:  UNALIAS, and Aliases on page 85.

  Usage:       The ALIAS command lets you create new command names
               or redefine internal commands.  It also lets you
               assign one or more commands to a single keystroke.
               An alias is often used to execute a complex series of
               commands with a few keystrokes or to create "in
               memory batch files" that run much faster than disk-
               based batch files.

               For example, to create a single-letter command D to
               display a wide directory, instead of using the longer
               DIR /W, you could use the command:

                    c:\> alias d = dir /w

               Now when you type a single d as a command, it will be
               translated into a DIR /W command.

               If you define aliases for commonly used application
               programs, you can often remove the directories
               they're stored in from the PATH.  For example, if you
               use Quattro Pro and had the C:\QPRO directory in your
               path, you could define the following alias:

                    c:\> alias qpro = c:\qpro\q.exe

               With this alias defined, you can probably remove
               C:\QPRO from your PATH.  Quattro Pro will now load
               more quickly than it would if the command processor
               had to search the PATH for it.  In addition, the PATH
               can be shorter, which will speed up searches for
               other programs.

               If you apply this technique for each application
               program, you can often reduce your PATH to just two
               or three directories containing utility programs, and
               significantly reduce the time it takes to load most
               software on your system.  Before removing a directory
               from the PATH, you will need to define aliases for
  -179-

               all the executable programs you commonly use which
               are stored in that directory.

               Aliases are stored in memory, and are not saved
               automatically when you turn off your computer or end
               your current session.  See page 183 for information
               on saving and reloading your aliases.


               Multiple Commands and Special Characters in Aliases

               An alias can represent more than one command.  For
               example:

                    c:\> alias letters = `cd \letters ^ text`

               creates a new command called LETTERS.  The command
               first uses CD to change to a subdirectory called
               \LETTERS and then runs a program called TEXT.  The
               caret [^] is the 4DOS command separator and indicates
               that the two commands are distinct and should be
               executed sequentially.  (The 4OS2 and 4NT command
               separator is normally an ampersand [&].)

               Aliases make extensive use of the command separator
               (see page 48), and the parameter character (see page
               158), and may also use the escape character (see page
               83).  These characters differ between 4DOS and 4OS2
               or 4NT.  In the text and examples below, we use the
               4DOS characters.  The difference is also explained
               the first time each character is used.  Be sure to
               insert the correct characters for the command
               processor you are using.  If you want to use the same
               aliases under different command processors, see page
               136.

               When you type alias commands at the command line or
               in a batch file, you must use back-quotes [`] around
               the definition if it contains multiple commands,
               parameters (discussed below), environment variables,
               redirection, or piping.  The back-quotes prevent
               premature expansion of these arguments.  You may use
               back-quotes around other definitions, but they are
               not required.  (You do not need back-quotes when your
               aliases are loaded from an ALIAS /R file; see below
               for details.)  The examples above and below include
               back-quotes only when they are required.


               Nested Aliases

               Aliases may invoke internal commands, external
               commands, or other aliases.  (However, an alias may
               not invoke itself, except in special cases where an
               IF or IFF command is used to prevent an infinite
               loop.)  The two aliases below demonstrate alias
               nesting (one alias invoking another).  The first line
  -180-

               defines an alias which runs a program called WP.EXE
               that is in the E:\WP60\ subdirectory.  The second
               alias changes directories with the PUSHD command,
               runs the WP alias, and then returns to the original
               directory with the POPD command:

                    c:\> alias wp = e:\wp60\wp.exe
                    c:\> alias w = `pushd c:\wp ^ wp ^ popd`

               The second alias above could have included the full
               path and name of the WP.EXE program instead of
               calling the WP alias.  However, writing two aliases
               makes the second one easier to read and understand,
               and makes the first alias available for independent
               use.  If you rename the WP.EXE program or move it to
               a new directory, only the first alias needs to be
               changed.


               Temporarily Disabling Aliases

               If you put an asterisk [*] immediately before a
               command in the value of an alias definition (the part
               after the equal sign), it tells the command processor
               not to attempt to interpret that command as another
               (nested) alias.  An asterisk used this way must be
               preceded by a space or the command separator and
               followed immediately by an internal or external
               command name.

               By using an asterisk, you can redefine the default
               options for any internal or external command.  For
               example, suppose that you always want to use the DIR
               command with the /2 (two column) and /P (pause at the
               end of each page) options.  The following line will
               do just that:

                    c:\> alias dir = *dir /2/p

               If you didn't include the asterisk, the second DIR on
               the line would be the name of the alias itself, and
               the command processor would repeatedly re-invoke the
               DIR alias, rather than running the DIR command.  This
               would cause an "Alias loop" or "Command line too
               long" error.  The asterisk forces interpretation of
               the second DIR as a command, not an alias.

               An asterisk also helps you keep the names of internal
               commands from conflicting with the names of external
               programs.  For example, suppose you have a program
               called LIST.COM.  Normally, the internal LIST command
               will run anytime you type LIST.  But two simple
               aliases will give you access to both the LIST.COM
               program and the LIST command:

                    c:\> alias list = c:\util\list.com
                    c:\> alias display = *list
  -181-

               The first line above defines LIST as an alias for the
               LIST.COM program.  If you stopped there, the external
               program would run every time you typed LIST and you
               would not have easy access to the internal LIST
               command.  The second line renames the internal LIST
               command as DISPLAY.  The asterisk is needed in the
               second command to indicate that the following word
               means the internal command LIST, not the LIST alias
               which runs your external program.

               Another way to understand the asterisk is to remember
               that a command is always checked for an alias first,
               then for an internal or external command, or a batch
               file (see page 138).  The asterisk at the beginning
               of a command name simply skips over the usual check
               for aliases when processing that command, and allows
               the command processor to go straight to checking for
               an internal command, external command, or batch file.

               You can also use an asterisk before a command that
               you enter at the command line or in a batch file.  If
               you do, that command won't be interpreted as an
               alias.  This can be useful when you want to be sure
               you are running the true, original command and not an
               alias with the same name, or temporarily defeat the
               purpose of an alias which changes the meaning or
               behavior of a command.  For example, above we defined
               an alias for DIR which made directories display in 2-
               column paged mode by default.  If you wanted to see a
               directory display in the normal single-column, non-
               paged mode, you could enter the command *DIR and the
               alias would be ignored during that one command.

               You can also disable aliases temporarily with the
               SETDOS /X command (see page 368).


               Partial Alias Names

               You can also use an asterisk in the name of an alias.
               When you do, the characters following the asterisk
               are optional when you invoke the alias command.
               (This is unrelated to the use of an asterisk in the
               alias value discussed above.)  For example, with this
               alias:

                    c:\> alias wher*eis = dir /sp

               the new command, WHEREIS, can be invoked as WHER,
               WHERE, WHEREI, or WHEREIS.  Now if you type:

                    c:\> where myfile.txt

               The WHEREIS alias will be expanded to the command:

                    dir /sp myfile.txt
  -182-

               Keystroke Aliases

               If you want to assign an alias to a keystroke, use
               the keyname on the left side of the equal sign,
               preceded by an at sign [@].  For example, to assign
               the command DIR /W to the F5 key, type

                    c:\> alias @F5 = dir /w

               See page 30 for a complete listing of key names and a
               description of the key name format.

               If you define a keystroke alias with a single at sign
               as shown above, then, when you press the F5 key, the
               value of the alias (DIR /W above) will be placed on
               the command line for you.  You can type additional
               parameters if you wish and then press Enter to
               execute the command (for example, with the alias
               above you could enter a file specification before
               pressing Enter).

               If you want the keystroke alias to take action
               automatically without waiting for you to edit the
               command line or press Enter, you can begin the
               definition with two at signs [@@].  The command
               processor will execute the alias "silently," without
               displaying its text on the command line.  For
               example, this command will assign an alias to the F6
               key that uses the CDD command to take you back to the
               previous default directory:

                    c:\> alias @@f6 = cdd -

               When you define keystroke aliases, the assignments
               will only be in effect at the command line, not
               inside application programs.  Be careful not to
               assign aliases to keys that are already used at the
               command line (like F1 for Help).  The command-line
               meanings take precedence and the keystroke alias will
               never be invoked.  If you want to use one of the
               command-line keys for an alias, you must first
               disable its regular use with the NormalKey or
               NormalEditKey directives in your .INI file.  See page
               162 for instructions.

           ##  You can also define a keystroke alias by using "@" or
               "@@" plus a scan code for one of the permissible keys
               (see the online help for a list of scan codes).  In
               most cases it will be easier to use key names.  Scan
               codes should only be used with unusual keyboards
               where a key name is not available for the key you are
               using.
  -183-

               Displaying Aliases

               If you want to see a list of all current ALIAS
               commands, type:

                    c:\> alias

               You can also view the definition of a single alias.
               For example, if you want to see the definition of the
               alias LIST, you can type:

                    c:\> alias list


               Saving and Reloading Your Aliases

               You can save your aliases to a file called ALIAS.LST
               this way:

                    c:\> alias > alias.lst

               You can then reload all the alias definitions in the
               file the next time you boot up with the command:

                    c:\> alias /r alias.lst

               This is much faster than defining each alias
               individually in a batch file.  If you keep your alias
               definitions in a separate file which you load when
               your system starts, you can edit them with a text
               editor, reload the edited file with ALIAS /R, and
               know that the same alias list will be loaded the next
               time you boot your computer.

               When you define aliases in a file that will be read
               with the ALIAS /R command, you do not need back-
               quotes around the value, even if back-quotes would
               normally be required when defining the same alias at
               the command line or in a batch file.

               To remove an alias, use the UNALIAS command.


               Alias Parameters

               Aliases can use command-line arguments or parameters
               like those in batch files.  The command-line
               arguments are numbered from %0 to %127.  %0 contains
               the alias name.  It is up to the alias to determine
               the meaning of the other parameters.  You can use
               quotation marks to pass spaces, tabs, commas, and
               other special characters in an alias parameter; see
               page 140 for details.

               Parameters that are referred to in an alias, but
               which are missing on the command line, appear as
               empty strings inside the alias.  For example, if you
  -184-

               put two parameters on the command line, any reference
               in the alias to %3 or any higher-numbered parameter
               will be interpreted as an empty string.

               The parameter %n& has a special meaning.  4DOS
               interprets it to mean "the entire command line, from
               argument n to the end."  If n is not specified, it
               has a default value of 1, so %& means "the entire
               command line after the alias name."  4OS2 and 4NT
               normally use a dollar sign [$] instead of an
               ampersand [&] to indicate the remainder of the
               command tail (for example, use %$ to refer to all
               parameters under 4OS2 or 4NT).  The special parameter
               %# contains the number of command-line arguments.

               For example, the following alias will change
               directories, perform a command, and return to the
               original directory:

                    c:\> alias in `pushd %1 ^ %2& ^ popd`

               When this alias is invoked as:

                    c:\> in c:\comm mycomm /zmodem /56K

               the first parameter, %1, has the value c:\comm.  %2
               is mycomm, %3 is /zmodem, and %4 is /56K.  The
               command line expands into these three separate
               commands:

                    pushd c:\comm
                    mycomm /zmodem /56K
                    popd

           ##  This next example uses the IFF command to redefine
               the defaults for SET.  It should be entered on one
               line:

                    c:\> alias set = `iff %# == 0 then ^ *set /p
                         ^ else ^ *set %& ^ endiff`

               This modifies the SET command so that if SET is
               entered with no arguments, it is replaced by SET /P
               (pause after displaying each page), but if SET is
               followed by an argument, it behaves normally.  Note
               the use of asterisks (*set) to prevent alias loops.

           ##  If an alias uses parameters, command-line arguments
               will be deleted up to and including the highest
               referenced argument.  For example, if an alias refers
               only to %1 and %4, then the first and fourth
               arguments will be used, the second and third
               arguments will be discarded, and any additional
               arguments beyond the fourth will be appended to the
               expanded command (after the value portion of the
               alias).  If an alias uses no parameters, all of the
  -185-

               command-line arguments will be appended to the
               expanded command.

           ##  Aliases also have full access to all variables in the
               environment, internal variables, and variable
               functions.  For example, you can create a simple
               command-line calculator this way:

                    c:\> alias calc = `echo The answer is:
                    %@eval[%&]`

               Now, if you enter:

                    c:\> calc 5 * 6

               the alias will display:

                    The answer is: 30


           ##  Expanding Aliases at the Prompt

               You can expand an alias on the command line and view
               or edit the results by pressing Ctrl-F after typing
               the alias name, but before the command is executed.
               This replaces the alias with its contents, and
               substitutes values for each alias paramter, just as
               if you had pressed the Enter key.  However, the
               command is not executed; it is simply redisplayed on
               the command line for additional editing.

               Ctrl-F is useful when you are developing a complex
               alias, or if you want to check on whether a command
               is invoking an alias.


           ##  Local and Global Aliases

               The aliases can be stored in either a "local" or
               "global" list.  You can control the type of alias
               list with the LocalAliases directive in the .INI file
               (see page 150), and with the /L and /LA options of
               the START command (see page 374).

               With a local alias list, any changes made to the
               aliases will only affect the current copy of the
               command processor.  They will not be visible in other
               shells or sessions.  This is the default under 4DOS.

               With a global alias list, all copies of the command
               processor will share the same alias list, and any
               changes made in one copy will affect all other
               copies.  This is the default for 4OS2 and 4NT.

               There is no fixed rule for determining whether to use
               a local or global alias list.  Depending on your work
               style, you may find it most convenient to use one
  -186-

               type, or a mixture of types in different sessions or
               shells.  We recommend that you start with the default
               approach for your command processor, then modify it
               if you find a situation where the default is not
               convenient.

               Whenever you start a secondary shell (see page 8)
               which uses a local alias list, it inherits a copy of
               the aliases from the previous shell.  However, any
               changes to the aliases made in the secondary shell
               will affect only that shell.  If you want changes
               made in a secondary shell to affect the previous
               shell, use a global alias list in both shells.

      4DOS     If you select a global alias list for 4DOS running
               under DOS, you can share the aliases among all copies
               of 4DOS.  However, if you run 4DOS under OS/2, global
               lists will apply within each DOS session, but will
               not allow you to share aliases between different
               sessions.


      4OS2,##  Retaining Global Aliases with SHRALIAS
      4NT
               If you select a global alias list for 4OS2 or 4NT,
               you can share the aliases among all copies of the
               command processor running in any session.  When you
               close all 4OS2 or 4NT sessions, the memory for the
               global alias list is released, and a new, empty alias
               list is created the next time you start 4OS2 or 4NT.

               If you want the alias list to be retained in memory
               even when no command processor session is running,
               you need to execute the SHRALIAS command (see page
               372), which loads a program to perform this service
               for global aliases, command history (see page 40),
               and directory history (page 47).

               You may find it convenient to execute SHRALIAS from
               your 4START file (see page 93), or, under OS/2, from
               STARTUP.CMD (see your Introduction and Installation
               Guide for details).


           ##  The UNKNOWN_CMD Alias

               If you create an alias with the name UNKNOWN_CMD, it
               will be executed any time the command processor would
               normally issue an "Unknown command" error message.
               This allows you to define your own handler for
               unknown commands.  When the UNKNOWN_CMD alias is
               executed, the command line which generated the error
               is passed to the alias for possible processing.  For
               example, to display the command that caused the
               error:

                    alias unknown_cmd `echo Error in command "%&"`
  -187-

               If the UNKNOWN_CMD alias contains an unknown command,
               it will call itself repeatedly.  If this occurs the
               command processor will loop up to 10 times, then
               display an "UNKNOWN_CMD loop" error.

  Options:     /P(ause):  This option is only effective when ALIAS
               is used to display existing definitions.  It pauses
               the display after each page and waits for a keystroke
               before continuing (see page 50).

               /R(ead file):  This option loads an alias list from a
               file.  The format of the file is the same as that of
               the ALIAS display:

                         name=value

               where name is the name of the alias and value is its
               value.  You can use an equal sign [=] or space to
               separate the name and value.  Back-quotes are not
               required around the value.  You can add comments to
               the file by starting each comment line with a colon
               [:].  You can load multiple files with one ALIAS /R
               command by placing the names on the command line,
               separated by spaces:

                    c:\> alias /r alias1.lst alias2.lst

               Each definition in an ALIAS /R file can be up to 511
               characters long in 4DOS, or 2047 characters in 4OS2
               and 4NT.  The definitions can span multiple lines in
               the file if each line, except the last, is terminated
               with an escape character (see page 83).
  -188-

  ASSOC      [4NT]                                        (Compatible)

  Purpose:     Modify or display relationships between file
               extensions and file types stored in the Windows NT
               registry.

  Format:      ASSOC [/P] [.ext[=[filetype]]]

               .ext:     The file extension whose file type you want
               to display or set.
               filetype: A file type stored in the Windows NT
               registry.

               /P(ause)

               See also:  FTYPE, and Executable Extensions on page
               75.

  Usage:       ASSOC allows you to create, modify, or display
               associations between file extensions and file types
               stored in the Windows NT registry.

               ASSOC manages "indirect" Windows NT file associations
               stored under the registry handle HKEY_CLASSES_ROOT,
               and discussed in more detail on pages 20 and 77.  If
               you are not familiar with file associations be sure
               to read about them before using ASSOC.

               If you invoke ASSOC with no parameters, it will
               display the current associations.  If you include a
               .ext, with no equal sign or filetype, ASSOC will
               display the current association for that extension.

               If you include the equal sign and filetype, ASSOC
               will create or update the association for extension
               .ext to refer to the specified file type.  The valid
               filetypes depend on the contents of your Windows NT
               registry.  See the FTYPE command or your Windows NT
               documentation for additional details.

               ASSOC cannot delete an extension from the registry.
               However, you can create a similar effect by
               associating the extension with an empty file type
               using ASSOC .ext=, without the filetype parameter.

           !   ASSOC should be used with caution, and only after
               backing up the registry.  Improper changes to file
               associations can prevent applications and / or the
               operating system from working properly.

  Options:     /P(ause):  Wait for a key to be pressed after each
               screen page before continuing the display.  Your
               options at the prompt are explained in detail on page
               50.
  -189-

  ATTRIB                                                    (Enhanced)

  Purpose:     Change or view file and subdirectory attributes.

  Format:      ATTRIB [/A:[[-]rhsda] /D /E /P /Q /S] [+|-[AHRS]]
               file ...

               file:  A file, directory, or list of files or
               directories on which to operate.

               /A: (Attribute select)   /P(ause)
               /D(irectories)           /Q(uiet)
               /E (No error messages)   /S(ubdirectories)

               Attribute flags:

                    +A   Set the archive attribute
                    -A   Clear the archive attribute
                    +H   Set the hidden attribute
                    -H   Clear the hidden attribute
                    +R   Set the read-only attribute
                    -R   Clear the read-only attribute
                    +S   Set the system attribute
                    -S   Clear the system attribute

  File Selection:   Supports extended wildcards, ranges, multiple
               file names, and include lists (see pages 64 - 73).
               Use extended wildcards with caution on LFN volumes;
               see page 74 for details.

  Usage:       Every file and subdirectory has 4 attributes that can
               be turned on (set) or turned off (cleared):  Archive,
               Hidden, Read-only, and System.  For details on the
               meaning of each attribute, see page 15.  The ATTRIB
               command lets you view, set, or clear attributes for
               any file, group of files, or subdirectory.

               You can view file attributes by entering ATTRIB
               without specifying new attributes (i.e., without the
               [+|-[AHRS]] part of the format).  (You can also view
               file attributes with the DIR /T command.)

               The primary use of ATTRIB is to set attributes.  For
               example, you can set the read-only and hidden
               attributes for the file MEMO:

                    c:\> attrib +rh memo

               Attribute options apply to the file(s) that follow
               the options on the ATTRIB command line.  The example
               below shows how to set different attributes on
               different files with a single command.  It sets the
               archive attribute for all .TXT files, then sets the
               system attribute and clears the archive attribute for
               TEST.COM:

                    c:\> attrib +a *.txt +s -a test.com
  -190-

               When you use ATTRIB on an HPFS, NTFS, or LFN drive,
               you must quote any file names which contain
               whitespace or special characters.  See page 14 for
               additional details.

               To change directory attributes, use the /D switch.
               If you give ATTRIB a directory name instead of a file
               name, and omit /D, it will append "\*.*" to the end
               of the name and act on all files in that directory,
               rather than acting on the directory itself.

           ##  Your operating system also supports "D"
               (subdirectory) and "V" (volume label) attributes.
               These attributes cannot be altered with ATTRIB; they
               are designed to be controlled only by the operating
               system itself.

           ##  ATTRIB will ignore underlines in the new attribute
               (the [+|-[AHRS]] part of the command).  For example,
               ATTRIB sees these 2 commands as identical:

                    c:\> attrib +a filename
                    c:\> attrib +__A_ filename

               This allows you to use a string of attributes from
               either the @ATTRIB variable function or from ATTRIB
               itself (both of which use underscores to represent
               attributes that are not set) and send that string
               back to ATTRIB to set attributes for other files.
               For example, to clear the attributes of FILE2 and
               then set its attributes to match those of FILE1
               (enter this on one line):

                    c:\> attrib -arhs file2 ^ attrib
                    +%@attrib[file1] file2

  Options: ##  /A:  (Attribute select): Select only those files that
               have the specified attribute(s) set.  See Attribute
               Switches on page 174 for information on the
               attributes which can follow /A:.

               The /A: switch specifies which files to select, not
               which attributes to set.  For example, to remove the
               archive attribute from all hidden files, you could
               use this command:

                    c:\> attrib /a:h -a *.*

               /D(irectories):  If you use the /D option, ATTRIB
               will modify the attributes of subdirectories in
               addition to files (yes, you can have a hidden
               subdirectory):

                    c:\> attrib /d +h c:\mydir

               If you use a directory name instead of a file name,
               and omit /D, ATTRIB will append "\*.*" to the end of
  -191-

               the name and act on all files in that directory,
               rather than acting on the directory itself.

               /E  (No error messages):  Suppress all non-fatal
               error messages, such as "File Not Found."  Fatal
               error messages, such as "Drive not ready," will still
               be displayed.  This option is most useful in batch
               files and aliases.

               /P(ause):  Wait for a key to be pressed after each
               screen page before continuing the display.  Your
               options at the prompt are explained in detail on page
               50.

               /Q(uiet):  This option turns off ATTRIB's normal
               screen output.  It is most useful in batch files.

               /S(ubdirectories):  If you use the /S option, the
               ATTRIB command will be applied to all matching files
               in the current or named directory and all of its
               subdirectories.
  -192-

  BEEP                                                           (New)

  Purpose:     Beep the speaker or play simple music.

  Format:      BEEP [frequency duration ...]

               frequency:  The beep frequency in Hertz (cycles per
               second).
               duration:  The beep length in 1/18th second
               intervals.

  Usage:       BEEP generates a sound through your computer's
               speaker.  It is normally used in batch files to
               signal that an operation has been completed, or that
               the computer needs attention.

               Because BEEP allows you to specify the frequency and
               duration of the sound, you can also use it to play
               simple music or to create different kinds of signals
               for the user.

               You can include as many frequency and duration pairs
               as you wish.  No sound will be generated for
               frequencies less than 20 Hz, allowing you to use BEEP
               as a way to create short delays.  The default value
               for frequency is 440 Hz; the default value for
               duration is 2.

               This batch file fragment runs a program called DEMO,
               then plays a few notes and waits for you to press a
               key:

                    demo ^ beep 440 4  600 2  1040 6
                    pause Finished with the demo - hit a key...

               The following table gives the frequency values for a
               five octave range (middle C is 262 Hz):
  -193-


                    C      131   262   523   1046  2093

                    C#/Db  139   277   554   1108  2217

                    D      147   294   587   1174  2349

                    D#/Eb  156   311   622   1244  2489

                    E      165   330   659   1318  2637

                    F      175   349   698   1397  2794

                    F#/Gb  185   370   740   1480  2960

                    G      196   392   784   1568  3136

                    G#/Ab  208   415   831   1662  3322

                    A      220   440   880   1760  3520

                    A#/Bb  233   466   932   1864  3729

                    B      248   494   988   1976  3951
  -194-

  BREAK      [4DOS, 4NT]                                  (Compatible)

  Purpose:     Display, enable, or disable Ctrl-C and Ctrl-Break
               checking.

  Format:      BREAK [ON | OFF]

  Usage:       The Ctrl-C and Ctrl-Break keys are used by many
               programs (including 4DOS) as a signal to interrupt
               the current operation.  BREAK controls how often DOS
               checks to see if you've entered one of these
               keystrokes.

       4NT     Ctrl-C and Ctrl-Break checking cannot actually be
               enabled or disabled under Windows NT.  4NT supports
               BREAK as a "do-nothing" command, for compatibility
               with CMD.EXE.  This avoids errors in batch files
               which use the BREAK command.  The additional
               discussion below applies only to 4DOS, not to 4NT.

               Normally, BREAK is turned off, and DOS only checks
               for Ctrl-C and Ctrl-Break keystrokes during DOS input
               or output operations involving the screen, keyboard,
               serial port, and printer.  However, many programs
               don't use DOS for these operations, and it can be
               difficult to interrupt them.

               When BREAK is turned on, DOS checks for Ctrl-C and
               Ctrl-Break every time a program calls DOS.  Since
               most programs use DOS to access files and perform
               other functions, turning BREAK on makes it much more
               likely that a Ctrl-C or Ctrl-Break will be noticed.
               If you turn BREAK on, programs will run slightly
               slower than normal (the difference is not usually
               noticeable).

               Turning BREAK on or off only affects when DOS detects
               Ctrl-C and Ctrl-Break and notifies the program you're
               running.  Any program can choose to ignore these
               signals.  Also, any program can change the BREAK
               setting on its own.

               Type BREAK plus ON or OFF to set the BREAK status, or
               BREAK by itself to display the current BREAK status.
               For example:

                    c:\> break on
                    c:\> break
                    BREAK is ON

               BREAK is off by default.  You can change the default
               by adding a BREAK=ON command to your CONFIG.SYS file.
  -195-

  CALL                                                    (Compatible)

  Purpose:     Execute one batch file from within another.

  Format:      CALL [/Q] file

               file:  The batch file to execute.

               /Q(uiet)

               See also CANCEL and QUIT.

  Usage:       CALL allows batch files to call other batch files
               (batch file nesting).  The calling batch file is
               suspended while the called (second) batch file runs.
               When the second batch file finishes, the original
               batch file resumes execution at the next command.  If
               you execute a batch file from inside another batch
               file without using CALL, the first batch file is
               terminated before the second one starts.

               The following batch file fragment compares an input
               line to "wp" and calls another batch file if it
               matches:

                    input  Enter your choice:  %%option
                    if "%option" == "wp" call wp.bat

               4DOS, 4OS2, and 4NT support batch file nesting up to
               ten levels deep.

               The current ECHO state is inherited by a called batch
               file, except when the 4OS2 /Q switch is used.

           ##  The called batch file should always either return (by
               executing its last line, or using the QUIT command),
               or terminate batch file processing with CANCEL.  Do
               not restart or CALL the original batch file from
               within the called file as this may cause an infinite
               loop or a stack overflow.

           ##  CALL returns an exit code which matches the batch
               file return code.  You can test this exit code with
               the %_? or %? environment variable (see page 112),
               and use it with conditional commands (see page 80).

  Option:      /Q(uiet):  Starts the new batch file with echo off,
       4OS2    regardless of the current batch file's echo state.
               This switch is provided for compatibility with OS/2's
               CMD.EXE.
  -196-

  CANCEL                                                         (New)

  Purpose:     Terminate batch file processing.

  Format:      CANCEL  [value]

               value:  The numeric exit code to return to the
               command processor.

               See also:  CALL and QUIT.

  Usage:       The CANCEL command ends all batch file processing,
               regardless of the batch file nesting level.  Use QUIT
               to end a nested batch file and return to the previous
               batch file.

               You can CANCEL at any point in a batch file.  If
               CANCEL is used from within an alias it will end
               execution of both the alias and any batch files which
               are running at the time.

               The following batch file fragment compares an input
               line to "end" and terminates all batch file
               processing if it matches:

                    input Enter your choice:  %%option
                    if "%option" == "end" cancel

           ##  If you specify a value, CANCEL will set the
               ERRORLEVEL or exit code to that value (see the IF
               command, and the %? variable on page 112).
  -197-

  CD / CHDIR                                                (Enhanced)

  Purpose:     Display or change the current directory.

  Format:      CD [/D] [ path | - ]
                    or
               CHDIR [/D] [ path | - ]

               path:  The directory to change to, including an
               optional drive name.

               /D(rive)

               See also:  CDD, MD, PUSHD, RD, and Directory
               Navigation on page 51.

  Usage:       CD and CHDIR are synonyms.  You can use either one.

               CD lets you navigate through a drive's subdirectory
               structure by changing the current working directory.
               If you enter CD and a directory name, the named
               directory becomes the new current directory.  For
               example, to change to the subdirectory
               C:\FINANCE\MYFILES:

                    c:\> cd \finance\myfiles
                    c:\finance\myfiles>

               Every disk drive on the system has its own current
               directory.  Specifying both a drive and a directory
               in the CD command will change the current directory
               on the specified drive, but will not change the
               default drive.  For example, to change the default
               directory on drive A:

                    c:\> cd a:\utility
                    c:\>

               Notice that this command does not change to drive A:.
               Use the CDD command to change the current drive and
               directory at the same time.

               When you use CD to change to a directory on an HPFS,
               NTFS, or LFN drive, you must quote the path name if
               it contains whitespace or special characters.  See
               page 14 for additional details.

               You can change to the parent directory with CD .. ;
               you can also go up one additional directory level
               with each additional [.].  For example, CD .... will
               go up three levels in the directory tree (see page 64
               for additional details).  You can move to a sibling
               directory -- one that branches from the same parent
               directory as the current subdirectory -- with a
               command like CD ..\newdir.
  -198-

               If you enter CD with no argument or with only a disk
               drive name, it will display the current directory on
               the default or named drive.

               If CD cannot change to the directory you have
               specified it will attempt to search the CDPATH (see
               page 56) and the extended directory search database
               (see page 53) in order to find a matching directory
               and switch to it.  You can also use wildcards in the
               path to force an extended directory search (see page
               55).  Read the section on Directory Navigation
               beginning on page 51 for complete details on these
               and other directory navigation features.

               CD saves the current directory before changing to a
               new directory.  You can switch back to the previous
               directory by entering CD - (there must be a space
               between the CD command and the hyphen).  You can
               switch back and forth between two directories by
               repeatedly entering CD -.  The saved directory is the
               same for both the CD and CDD commands.  Drive changes
               and automatic directory changes (see page 45) also
               modify the saved directory, so you can use CD - to
               return to a directory that you exited with an
               automatic directory change.

               Directory changes made with CD are also recorded in
               the directory history list and can be displayed in
               the directory history window (see page 46), which
               allows you to return quickly to a recently-used
               directory.

           ##  CD never changes the default drive.  If you change
               directories on one drive, switch to another drive,
               and then enter CD -, the directory will be restored
               on the first drive but the current drive will not be
               changed.

               The operating system limits the permissible length of
               the full subdirectory name.  See page 12 for more
               information on directory names.

  Option:      D(rive):  Changes the current drive as well as
       4NT     directory (like CDD).  This option is included for
               compatibility with the undocumented CD /D command
               available in Windows NT 4.0's CMD.EXE.
  -199-

  CDD                                                            (New)

  Purpose:     Change the current disk drive and directory.

  Format:      CDD [/A /S[drive ...]] [path | - ]

               path:  The name of the directory (or drive and
               directory) to change to.

               drive:  A drive or list of drives to include in the
               extended directory search database.

               /A(ll drives)            /S(earch tree)

               See also:  CD, MD, PUSHD, RD, and Directory
               Navigation on page 51.

  Usage:       CDD is similar to the CD command, except that it also
               changes the default disk drive if one is specified.
               CDD will change to the directory and drive you name.
               To change from the root directory on drive A to the
               subdirectory C:\WP:

                    a:\> cdd c:\wp
                    c:\wp>

               You can change to the parent directory with CDD .. ;
               you can also go up one additional directory level
               with each additional [.].  For example, CDD .... will
               go up three levels in the directory tree (see page 64
               for additional details).

               CDD can also change to a network drive and directory
               specified with a UNC name (see page 12 for
               information on UNC names).

               When you use CDD to change to a directory on an HPFS,
               NTFS, or LFN drive, you must quote the path name if
               it contains whitespace or special characters.  See
               page 14 for additional details.

               If CDD cannot change to the directory you have
               specified it will attempt to search the CDPATH (see
               page 56) and the extended directory search database
               (see page 53) in order to find a matching directory
               and switch to it.  You can also use wildcards in the
               path to force an extended directory search (see page
               55).  Read the section on Directory Navigation
               beginning on page 51 for complete details on these
               and other directory navigation features.

               CDD saves the current drive and directory before
               changing to a new directory.  You can switch back to
               the previous drive and directory by entering CDD -
               (there must be a space between the CDD command and
               the hyphen).  You can switch back and forth between
               two drives and directories by repeatedly entering CDD
  -200-

               -.  The saved directory is the same for both the CD
               and CDD commands.  Drive changes and automatic
               directory changes (see page 45) also modify the saved
               directory, so you can use CDD - to return to a
               directory that you exited with a drive change or an
               automatic directory change.

               Directory changes made with CDD are also recorded in
               the directory history list and can be displayed in
               the directory history window (see page 46), which
               allows you to return quickly to a recently-used
               directory.

               The operating system limits the permissible length of
               the full subdirectory name.  See page 12 for more
               information on directory names.

  Options:     /A(ll drives):  When CDD is used with this option, it
               displays the current directory on all drives from C:
               to the last drive in the system.  You cannot move to
               a new drive and directory and use /A in the same
               command.

               /S(earch tree):  Builds or rebuilds the Extended
               Directory Search database, JPSTREE.IDX (see page 53).
               You cannot move to a new drive and directory and use
               /S in the same command.

               To include all local hard drives in the database use
               the command:

                    cdd /s

               To limit or add to the list of drives included in the
               database, list the drives and network volume names
               after the /S switch.  For example, to include drives
               C, D, E, and the network volume \\server\dir1 in the
               database, use this command:

                    cdd /s cde \\server\dir1

               All non-hidden directories on the listed drives will
               be indexed; you cannot restrict the database to
               certain directories within a drive.  Each time you
               use /S, everything in the previous directory database
               is replaced by the new database that is created.
  -201-

  CHCP      [4DOS, 4OS2]                                  (Compatible)

  Purpose:     Display or change the current system code page.

  Format:      CHCP [n]

               n:  A system code page number.

  ## Usage:    Code page switching allows you to select different
               character sets for language support.  To use code
               page switching, you must have an EGA or VGA display
               and be running under MS-DOS or PC-DOS 3.3 or above,
               or OS/2.  CHCP is not available in 4NT.

               If you enter CHCP without a number, the current code
               page is displayed.

                    c:\> chcp
                    Active code page: 437

               If you enter CHCP plus a code page number, the code
               page is changed.  For example, to set the code page
               to multilingual:

                    c:\> chcp 850

               When you use CHCP under DOS, it affects the entire
               system.  When you use CHCP under OS/2 it only affects
               the current 4OS2 session, and any new programs
               started from within that session; the active code
               page in other sessions remains unchanged.

       4DOS    Before using CHCP under DOS, you must first load the
               device drivers (in CONFIG.SYS), make sure the
               information file (COUNTRY.SYS) is available, load
               national language support (using the NLSFUNC
               command), and prepare the specified code page for the
               devices (using the MODE command with the CODEPAGE
               PREPARE option).

               CHCP accepts one of the prepared system code pages.
               An error message is displayed if a code page is
               selected that has not been prepared for the system.

               See your DOS or OS/2 documentation for more
               information on CHCP.
  -202-

  CLS                                                       (Enhanced)

  Purpose:     Clear the video display and move the cursor to the
               upper left corner; optionally change the default
               display and border colors.

  Format:      CLS [/C /S] [[BRIght] [BLInk] fg ON [BRIght] bg]
               [BORder bc]

               fg:  The new foreground color
               bg:  The new background color
               bc:  The new border color

               /C(lear buffer)          /S(croll buffer)

  Usage:       CLS can be used to clear the screen without changing
               colors, or to clear the screen and change the screen
               colors simultaneously.  These three examples show how
               to clear the screen to the default colors, to bright
               white letters on a blue background, and to bright
               yellow letters on a magenta background with a blue
               border:

                    c:\> cls
                    c:\> cls bright white on blue
                    c:\> cls bri yel on mag bor blu

               CLS is often used in batch files to clear the screen
               before displaying text.

               See page 27 for details about colors and color names,
               and notes on the use of bright background colors.

       4DOS ## Under DOS, if ANSI.SYS or a compatible driver is not
               loaded, the colors will not be "sticky" -- you may
               lose them after you run an application.  See page 25
               for additional details.  If your display accommodates
               more than 25 rows by 80 columns and CLS doesn't clear
               the whole screen, your ANSI driver probably does not
               support the large display properly.

  Options:     /C(lear buffer):  Clear the entire scrollback buffer.
       4NT     If /C is not used, only the visible portion of the
               4NT screen is cleared.

               /S(croll buffer):  Clear the screen by scrolling the
       4NT     buffer, rather than filling the screen with blanks
               (the default method ).  This preserves the text on
               the screen in the scrollback buffer if it is larger
               than the visible window.  This switch may not give
               correct results when the buffer size is less than
               twice the window size.
  -203-

  COLOR                                                          (New)

  Purpose:     Change the default display colors.

  Format:      COLOR [BRIght] [BLInk] fg ON [BRIght] bg [BORder bc]

               fg:  The new foreground color
               bg:  The new background color
               bc:  The new border color

               See also:  CLS, and page 27 for details about using
               colors.

  Usage:       COLOR is normally used in batch files before
               displaying text.  For example, to set screen colors
               to bright white on blue, you can use this command:

                    c:\> color bright white on blue

       4DOS    If you have an ANSI driver (such as ANSI.SYS)
               installed, COLOR will not change anything on the
               screen.  It will only set the default colors for
               subsequent screen displays.  If you are not using an
               ANSI driver, COLOR will change the display colors of
               every character on the screen.  However, the colors
               will not be "sticky" -- you may lose them after you
               run an application.  See page 25 for additional
               details on ANSI drivers.

       4DOS ## If you see odd characters like "[44;37m" when you try
               to set the screen colors, 4DOS probably thinks you
               have an ANSI driver loaded when you don't.  Use
               SETDOS /A2, the Display page of the OPTION dialogs,
               or ANSI = No in 4DOS.INI, to tell 4DOS you have no
               ANSI driver.

       4NT  ## 4NT also supports the same syntax as the version of
               CMD.EXE that is included with Windows NT 4.0 and
               later:

                    COLOR bf

               In this syntax, b is a hexadecimal digit that
               specifies the background color and f is a hexadecimal
               digit that specifies the foreground color.  See your
               Windows NT documentation for more information.
  -204-

  COPY                                                      (Enhanced)

  Purpose:     Copy data between disks, directories, files, or
               physical hardware devices (such as your printer or
               serial port).

  Format:      COPY [/A:[[-]rhsda] /C /E /H /K /M /N /P /Q /R /S /T
               /U /V /X /Z] source[+] ... [/A /B] destination [/A
               /B]

               source:  A file or list of files or a device to copy
               from.
               destination:  A file, directory, or device to copy
               to.

               /A(SCII)                 /P(rompt)
               /A: (Attribute select)   /Q(uiet)
               /B(inary)                /R(eplace)
               /C(hanged)               /S(ubdirectories)
               /E (no error messages)   /T(otals)
               /H(idden)                /U(pdate)
               /K(eep attributes)       /V(erify)
               /M(odified)              /X (clear archive)
               /N(othing)               /Z (overwrite)

               See also:  ATTRIB, MOVE, and REN.

  File Selection:   Supports extended wildcards, ranges, multiple
               file names, and include lists (see pages 64 - 73),
               and the clipboard device (CLIP:).  Date, time, size,
               or exclude ranges anywhere on the line apply to all
               source files.  Use extended wildcards with caution on
               LFN volumes; see page 74 for details.

  Usage:       The COPY command accepts all traditional syntax and
               options and adds many new features.

               The simplest use of COPY is to make a copy of a file,
               like this example which makes a copy of a file called
               FILE1.ABC:

                    c:\> copy file1.abc file2.def

               You can also copy a file to another drive and/or
               directory.  The following command copies FILE1 to the
               \MYDIR directory on drive E:

                    c:\> copy file1 e:\mydir

               When you COPY files to or from an HPFS, NTFS, or LFN
               drive, you must quote any file names which contain
               whitespace or special characters.  See page 14 for
               additional details.
  -205-

               Copying Files

               You can copy several files at once by using
               wildcards:

                    c:\> copy *.txt e:\mydir

               (See page 64 for an explanation of the wildcard
               characters [*] and [?].)

               You can also list several source files in one
               command.  The following command copies 3 files from
               the current directory to the \MYDIR directory on
               drive E:

                    c:\> copy file1 file2 file3 e:\mydir

               COPY also understands include lists (see page 73), so
               you can specify several different kinds of files in
               the same command.  This command copies the .TXT,
               .DOC, and .BAT files from the E:\MYDIR directory to
               the root directory of drive A:

                    c:\> copy e:\mydir\*.txt;*.doc;*.bat a:\

               If there is only one argument on the line, COPY
               assumes it is the source, and uses the current drive
               and directory as the destination.  For example, the
               following command copies all the .DAT files on drive
               A to the current directory on drive C:

                    c:\data> copy a:*.dat

               If there are two or more arguments on the line,
               separated by spaces, then COPY assumes that the last
               argument is the destination and copies all source
               files to this new location.  If the destination is a
               drive, directory, or device name then the source
               files are copied individually to the new location.
               If the destination is a file name, the first source
               file is copied to the destination, and any additional
               source files are then appended to the new destination
               file.

               For example, the first of these commands copies the
               .DAT files from the current directory on drive A
               individually to C:\MYDIR (which must already exist as
               a directory); the second appends all the .DAT files
               together into one large file called C:\DATA (assuming
               C:\DATA is not a directory):

                    c:>\ copy a:*.dat c:\mydir\
                    c:>\ copy a:*.dat c:\data

               When you copy to a directory, if you add a backslash
               [\] to the end of the name as shown in the first
               example above, COPY will display an error message if
  -206-

               the name does not refer to an existing directory.
               You can use this feature to keep COPY from treating a
               mistyped destination directory name as a file name
               and attempting to append all your source files to a
               destination file, when you really meant to copy them
               individually to a destination directory.

               To copy a file to a device such as the printer, use
               the device name as the destination, for example:

                    c:\> copy schedule.txt prn

               To copy text to or from the clipboard use CLIP: as
               the device name.  Using CLIP: with non-text data will
               produce unpredictable results.  See page 58 for
               additional information on CLIP:, including details on
               when you can use the clipboard under 4DOS.


               Appending Files

           ##  A plus [+] tells COPY to append two or more files to
               a single destination file.  If you list several
               source files separated with [+] and don't specify a
               destination, COPY will use the name of the first
               source file as the destination, and append each
               subsequent file to the first file.

               For example, the following command will append the
               contents of C:\MEMO2 and C:\MEMO3 to C:\MEMO1 and
               leave the combined contents in the file named
               C:\MEMO1:

                    c:\> copy memo1+memo2+memo3

               To append the same three files but store the result
               in BIGMEMO:

                    c:\> copy memo1+memo2+memo3 bigmemo

               If no destination is specified, the destination file
               will always be created in the current directory even
               if the first source file is in another directory or
               on another drive.  For example, this command will
               append C:\MEM\MEMO2 and C:\MEM\MEMO3 to
               D:\DATA\MEMO1, and leave the result in C:\MEM\MEMO1:

                    c:\mem> copy d:\data\memo1+memo2+memo3

           ##  You cannot append files to a device (such as a
               printer); if you try to do so, COPY will ignore the
               [+] signs and copy the files individually.  If you
               attempt to append several source files to a
               destination directory or disk, COPY will append the
               files and place the copy in the new location with the
               same name as the first source file.
  -207-

           ##  Advanced Features

               If your destination has wildcards in it, COPY will
               attempt to match them with the source names.  For
               example, this command copies the .DAT files from
               drive A to C:\MYDIR and gives the new copies the
               extension .DX:

                    c:\> copy a:*.dat c:\mydir\*.dx

               This feature can give you unexpected results if you
               use it with multiple source file names.  For example,
               suppose that drive A contains XYZ.DAT and XYZ.TXT.
               The command

                    c:\> copy a:\*.dat a:\*.txt c:\mydir\*.dx

               will copy A:XYZ.DAT to C:\MYDIR\XYZ.DX.  Then it will
               copy A:XYZ.TXT to C:\MYDIR\XYZ.DX, overwriting the
               first file it copied.

               You can use date, time, and size ranges to further
               define the files that you want to copy (see page 67
               for information on ranges).  This example copies
               every file in the E:\MYDIR directory, which was
               created or modified yesterday, and which is also
               10,000 bytes or smaller in size, to the root
               directory of drive A:

                    c:\> copy /[d-1] /[s0,10000] e:\mydir\*.* a:\

               You can also use file exclusion ranges to restrict
               the list of files that would normally be selected
               with wildcards.  This example copies every file in
               the E:\MYDIR directory except backup (.BAK or .BK!)
               files:

                    c:\> copy /[!*.bak;*.bk!] e:\mydir\*.* a:\

               COPY will normally process source files which do not
               have the hidden or system attribute, and will ignore
               the read-only and archive attributes.  It will always
               set the archive attribute and clear the read-only
               attribute of destination files.  In addition, if the
               destination is an existing file with the read-only
               attribute, COPY will generate an "Access Denied"
               error and refuse to overwrite the file.  You can
               alter some of these behaviors with switches (see the
               individual switch descriptions below for complete
               details):

                    /A:  Forces COPY to process source files with
                         the attributes you specify.

                    /H   Forces COPY to process hidden and system
                         source files, and preserves the hidden and
  -208-

                         system attributes when creating destination
                         files.

                    /K   Retains the read-only attribute from each
                         source file when creating the destination
                         file.

                    /Z   Forces COPY to overwrite an existing read-
                         only destination file.

           !   Use caution with /A:, /H, or /K when both the source
               and destination directories contain file
               descriptions.  If the source specification matches
               the description file name (normally DESCRIPT.ION),
               and you use a switch which tells COPY to process
               hidden files, the DESCRIPT.ION file itself will be
               copied, overwriting any existing descriptions in the
               destination directory.  For example, if the \DATA
               directory contains file descriptions this command
               would overwrite any existing descriptions in the
               \SAVE directory:

                    c:\data> copy /h d*.* \save\

       4DOS    If you are using 4DOS in an OS/2 DOS session, COPY
               will copy OS/2 extended attributes from the source to
               the destination, if the file system on the
               destination drive supports them.

       4OS2    If you copy a file from a FAT volume to an HPFS
               volume, and you do not give an explicit destination
               name (i.e. you are moving the file to the current
               directory), or the destination name is made up
               entirely of wildcards), COPY will look for a
               .LONGNAME extended attribute for the source file.  If
               it finds that attribute, it will use the long name
               for the destination file; otherwise, it will use the
               short name.

               Similarly, if you COPY files with long filenames from
               an HPFS volume to a FAT volume, 4OS2 will create the
               destination files with short, FAT-compatible names
               and save the long filenames in the .LONGNAME extended
               attribute.  The short name is created by replacing
               special characters with underscores, adding numeric
               digits to the filename (if necessary) to make the new
               name unique, and truncating the name to fit with in
               the "8.3" FAT name structure.

  Options:     The /A(SCII) and /B(inary) options apply to the
               preceding filename and to all subsequent filenames on
               the command line until the file name preceding the
               next /A or /B, if any.  The other options apply to
               all filenames on the command line, no matter where
               you put them.  For example, either of the following
               commands could be used to copy a font file to the
               printer in binary mode:
  -209-

                    c:\> copy /b myfont.dat prn
                    c:\> copy myfont.dat /b prn

               Some options do not make sense in certain contexts,
               in which case COPY will ignore them.  For example,
               you cannot prompt before replacing an existing file
               when the destination is a device such as the printer
               -- there's no such thing as an "existing file" on the
               printer.  If you use conflicting output options, like
               /Q and /P, COPY will generally take a "conservative"
               approach and give priority to the option which
               generates more prompts or more information.

               Options used in less common situations have been
               marked with ## below.  Remember that the options are
               in alphabetical order, so more basic options are
               interspersed with those marked with ##.

           ##  /A(SCII):  If you use /A with a source filename, the
               file will be copied up to, but not including, the
               first Ctrl-Z (Control-Z or ASCII 26) character in the
               file (some application programs use the Ctrl-Z to
               mark the end of a file).  If you use /A with a
               destination filename, a Ctrl-Z will be added to the
               end of the file.  /A is the default when appending
               files, or when the destination is a device like NUL
               or PRN, rather than a disk file.  Also see /B.

           ##  /A:  (Attribute select): Select only those files that
               have the specified attribute(s) set.  See Attribute
               Switches on page 174 for information on the
               attributes which can follow /A:.  See the caution
               under Advanced Features above before using /A: when
               both source and destination directories contain file
               descriptions.

               You must include the colon with this option to
               distinguish it from the /A(SCII) switch, above.

           ##  /B(inary):  If you use /B with a source filename, the
               entire file is copied; Ctrl-Z characters in the file
               do not affect the copy operation.  Using /B with a
               destination filename prevents addition of a Ctrl-Z to
               the end of the destination file.  /B is the default
               for normal file copies.  Also see /A.

               /C(hanged files):  Copy files only if the destination
               file exists and is older than the source (see also
               /U).  This option is useful for updating the files in
               one directory from those in another without copying
               any newly created files.

               /E  (No error messages):  Suppress all non-fatal
               error messages, such as "File not found."  Fatal
               error messages, such as "Drive not ready," will still
               be displayed.  This option is most useful in batch
               files and aliases.
  -210-

           ##  /H(idden):  Copy all matching files including those
               with the hidden and/or system attribute set (see page
               15). See the cautionary note under Advanced Features
               above before using /H when both source and
               destination directories contain file descriptions.

           ##  /K(eep attributes):  To maintain compatibility with
               COMMAND.COM, CMD.EXE, and Netware, COPY normally
               maintains the hidden and system attributes, sets the
               archive attribute, and removes the read-only
               attribute on the target file.  /K tells COPY to also
               maintain the read-only attribute on the destination
               file.  However, if the destination is on a Novell
               Netware volume, this option will have no effect; this
               is due to the way Netware handles file attributes,
               and is not a problem in COPY.

               /M(odified):  Copy only those files with the archive
               attribute set (see page 15), i.e., those which have
               been modified since the last backup.  The archive
               attribute of the source file will not be cleared
               after copying; to clear it use the /X switch, or use
               ATTRIB (page 189).

               /N(othing):  Do everything except actually perform
               the copy.  This option is useful for testing what the
               result of a complex COPY command will be.  /N does
               not prevent creation of destination subdirectories
               when it is used with /S.

               /P(rompt):  Ask the user to confirm each source file.
               Your options at the prompt are explained in detail on
               page 50.

               /Q(uiet):  Don't display filenames or the total
               number of files copied.  This option is most often
               used in batch files.  See also /T.

               /R(eplace):  Prompt the user before overwriting an
               existing file.   Your options at the prompt are
               explained in detail on page 50.

               /S(ubdirectories):  Copy the subdirectory tree
               starting with the files in the source directory plus
               each subdirectory below that.  The destination must
               be a directory; if it doesn't exist, COPY will
               attempt to create it.  COPY will also attempt to
               create needed subdirectories on the tree below the
               destination, including empty source directories.  If
               COPY /S creates one or more destination directories,
               they will be added automatically to the extended
               directory search database; see page 53 for details.

               If you attempt to use COPY /S to copy a subdirectory
               tree into part of itself, COPY will detect the
               resulting infinite loop, display an error message,
               and exit.
  -211-

               /T(otals):  Turns off the display of filenames, like
               /Q, but does display the total number of files
               copied.

               /U(pdate):  Copy each source file only if it is newer
               than a matching destination file or if a matching
               destination file does not exist (see also /C).  This
               option is useful for keeping one directory matched
               with another with a minimum of copying.

           ##  /V(erify):  Verify each disk write.  This is the same
               as executing the VERIFY ON command, but is only
               active during the COPY.  /V does not read back the
               file and compare its contents with what was written;
               it only verifies that the data written to disk is
               physically readable.

               /X:  Clears the archive attribute from the source
               file after a successful copy.  This option is most
               useful if you are using COPY to maintain a set of
               backup files.

           !## /Z:  Overwrites read-only destination files.  Without
               this option, COPY will fail with an "Access denied"
               error if the destination file has its read-only
               attribute set.  This option allows COPY to overwrite
               read-only files without generating any errors.
  -212-

  CTTY      [4DOS]                                        (Compatible)

  Purpose:     Change the default console device.

  Format:      CTTY device

               device:  The new console device.

  ##  Usage:   Normally, 4DOS uses the keyboard as the standard
               input device and the display as the standard output
               device.  Together, the keyboard and display are known
               as the console or CON.  The CTTY command allows you
               to substitute another device that can perform
               standard character I/O for the console.

               For example to change the console to the first serial
               port:

                    c:\> ctty com1

               Change the console back to the standard keyboard and
               display (this command must be entered from the
               current console, e.g., a terminal attached to COM1,
               or from a batch file):

                    c:\> ctty con

               CTTY works only for programs and commands that use
               standard DOS input and output functions.  This
               includes all 4DOS internal commands except DRAWBOX,
               DRAWHLINE, DRAWVLINE, LIST, SCREEN, SCRPUT, SELECT,
               and VSCRPUT.  In addition, if you use color-coded
               directories you should disable them with DIR /D when
               using CTTY.  Otherwise, directories will not be
               displayed correctly.
  -213-

  DATE                                                      (Enhanced)

  Purpose:     Display and optionally change the system date.

  Format:      DATE [/T] [mm-dd-yy]

               /T (Display only)

               mm:  The month (1 - 12).
               dd:  The day (1 - 31).
               yy:  The year (00 - 99, or a 4-digit year).

               See also:  TIME.

  Usage:       If you simply type DATE without any parameters, you
               will see the current system date and time, and be
               prompted for a new date.  Press ENTER if you don't
               wish to change the date.  If you type a new date, it
               will become the current system date, which is
               included in the directory entry for each file as it
               is created or altered:

                    c:\> date
                    Mon  Dec 22, 1997  9:30:06
                    Enter new date (mm-dd-yy):

               You can also enter a new system date by typing the
               DATE command plus the new date on the command line:

                    c:\> date 10-16-97

               You can use hyphens, slashes, or periods to separate
               the month, day, and year entries.  The year can be
               entered as a 2-digit or 4-digit value.  Two-digit
               years between 80 and 99 are interpreted as 1980 -
               1999; values between 00 and 79 are interpreted as
               2000 - 2079.

               DATE adjusts the format it expects depending on your
               country settings.  When entering the date, use the
               correct format for the country setting currently in
               effect on your system.

  Option:      /T  (Display only):  Displays the current date but
       4NT     does not prompt you for a new date.  If a new date is
               specified in the same command as /T the new date will
               be ignored.
  -214-

  DEL / ERASE                                               (Enhanced)

  Purpose:     Erase one file, a group of files, or entire
               subdirectories.

  Format:      DEL [/A:[[-]rhsda] /E /F /N /P /Q /S /T /W /X /Y /Z]
               file...
                    or
               ERASE [/A:[[-]rhsda] /E /F /N /P /Q /S /T /W /X /Y
               /Z] file...

               file:  The file, subdirectory, or list of files or
               subdirectories to erase.

               /A: (Attribute select)   /S(ubdirectories)
               /E (No error messages)   /T(otal)
               /F(orce delete)          /W(ipe)
               /N(othing)               /X (remove empty subdirs)
               /P(rompt)                /Y(es to all prompts)
               /Q(uiet)                 /Z(ap hidden and read-only
               files)

  File Selection:   Supports extended wildcards, ranges, multiple
               file names, and include lists (see pages 64 - 73).
               Use extended wildcards with caution on LFN volumes;
               see page 74 for details.

  Usage:       DEL and ERASE are synonyms, you can use either one.

           !   Use the DEL and ERASE commands with caution; the
               files and subdirectories that you erase may be
               impossible to recover without specialized utilities
               and a lot of work.

               To erase a single file, simply enter the file name:

                    c:\> del letters.txt

               You can also erase multiple files in a single
               command.  For example, to erase all the files in the
               current directory with a .BAK or .PRN extension:

                    c:\> del *.bak *.prn

               When you use DEL on an HPFS, NTFS, or LFN drive, you
               must quote any file names which contain whitespace or
               special characters.  See page 14 for additional
               details.

               To exclude files from a DEL command, use a file
               exclusion range (see page 72).  For example, to
               delete all files in the current directory except
               those whose extension is .TXT, use a command like
               this:

                    c:\> del /[!*.TXT] *.*
  -215-

               When using exclusion ranges or other more complex
               options you may want to use the /N switch first, to
               preview the effects of the DEL without actually
               deleting any files.

               If you enter a subdirectory name, or a filename
               composed only of wildcards (* and / or ?), DEL asks
               for confirmation (Y or N) unless you specified the /Y
               option.  If you respond with a Y, DEL will delete all
               the files in that subdirectory (hidden, system, and
               read-only files are only deleted if you use the /Z
               option).

               DEL displays the amount of disk space recovered,
               unless the /Q option is used (see below).  It does so
               by comparing the amount of free disk space before and
               after the DEL command is executed.  This amount may
               be incorrect if you are using a deletion tracking
               system which stores deleted files in a hidden
               directory, or if, under a multitasking system,
               another program performs a file operation while the
               DEL command is executing.

               Remember that DEL removes file descriptions along
               with files.  Most deletion tracking systems will not
               be able to save or recover a file's description, even
               if they can save or recover the data in a file.

           !   When a file is deleted, its disk space is returned to
               the operating system for use by other files.
               However, the contents of the file remain on the disk
               until they are overwritten by another file.  If you
               wish to obliterate a file or wipe its contents clean,
               use DEL /W, which overwrites the file with zeros
               before deleting it.  Use this option with caution --
               once a file is obliterated, it is impossible to
               recover.

           ##  DEL returns a non-zero exit code if no files are
               deleted, or if another error occurs.  You can test
               this exit code with the %_? environment variable (see
               page 112), and use it with conditional commands (&&
               and ||; see page 80).

  Options: ##  /A:  (Attribute select): Delete only those files that
               have the specified attribute(s) set.  See Attribute
               Switches on page 174 for information on the
               attributes which can follow /A:.

               /E  (No error messages):  Suppress all non-fatal
               error messages, such as "File Not Found."  Fatal
               error messages, such as "Drive not ready," will still
               be displayed.  This option is most useful in batch
               files and aliases.

       4DOS,## /F(orce delete):  This option is only for use in
  -216-

       4OS2    4OS2, and in 4DOS when running in an OS/2 2.1 or
               later DOS session.  It forces deletion of the file
               without saving it to the DELDIR directory (if DELDIR
               is not in use, /F has no effect).

               /N(othing):  Do everything except actually delete the
               file(s).  This is useful for testing what the result
               of a DEL would be.

               /P(rompt):  Prompt the user to confirm each erasure.
               Your options at the prompt are explained in detail on
               page 50.

               /Q(uiet):  Don't display filenames as they are
               deleted, or the number of files deleted or bytes
               freed.  When running 4DOS under DOS, DEL will run
               fastest if you specify the /Q option and the filename
               doesn't use the extended 4DOS wildcards.  When
               running 4OS2, 4NT, or 4DOS under OS/2, /Q will have
               little or no effect on DEL's speed.  See also /T.

           !   /S(ubdirectories):  Delete the specified files in
               this directory and all of its subdirectories.  This
               can be used to delete all the files in a subdirectory
               tree or even a whole disk.  It should be used with
               caution!

               /T(otal):  Don't display filenames as they are
               deleted, but display the total number of files
               deleted plus the amount of free disk space recovered.
               Unlike /Q, the /T option will not speed up deletions
               under DOS.

           !   /W(ipe):  Clear the file to zeros before deleting it.
               Use this option to completely obliterate a file's
               contents from your disk.  Once you have used this
               option it is impossible to recover the file even if
               you are using an undelete utility, because the
               contents of the file are destroyed before it is
               deleted.  /W overwrites the file only once; it does
               not adhere to security standards which require
               multiple overwrites with varying data when destroying
               sensitive information.

           ##  /X  (remove empty subdirectories):  Remove empty
               subdirectories after deleting (only useful when used
               with /S).  If DEL deletes one or more directories,
               they will be removed automatically from the extended
               directory search database; see page 53 for details.

           !## /Y(es):  The reverse of /P -- it assumes a Y response
               to everything, including deleting an entire
               subdirectory tree.  4DOS, 4OS2, and 4NT normally
               prompt before deleting files when the name consists
               only of wildcards or a subdirectory name (see above);
               /Y overrides this protection, and should be used with
               extreme caution!
  -217-

           !## /Z(ap):  Delete read-only, hidden, and system files
               as well as normal files.  Files with the read-only,
               hidden, or system attribute set are normally
               protected from deletion; /Z overrides this
               protection, and should be used with caution.  Because
               EXCEPT works by hiding files, /Z will override an
               EXCEPT command.  However, files specified in a file
               exclusion range (see page 72) will not be deleted by
               DEL /Z.

               For example, to delete the entire subdirectory tree
               starting with C:\UTIL, including hidden and read-only
               files, without prompting (use this command with
               CAUTION!):

                    c:\> del /sxyz c:\util\
  -218-

  DELAY                                                          (New)

  Purpose:     Pause for a specified length of time.

  Format:      DELAY [seconds]

               seconds:  The number of seconds to delay.

  Usage:       DELAY is useful in batch file loops while waiting for
               something to occur.  To wait for 10 seconds:

                    delay 10

               DELAY is most useful when you need to wait a specific
               amount of time for an external event, or check a
               system condition periodically.  For example, this
               batch file checks the battery status (as reported by
               your Advanced Power Management drivers) every 15
               seconds, and gives a warning when battery life falls
               below 30%:

                    do forever
                       iff %_apmlife lt 30 then
                          beep 440 4 880 4 440 4 880 4
                          echo Low Battery!!
                       endiff
                       delay 15
                    enddo

               The seconds value can be as large as 3600 (one hour)
               in 4DOS, about 4 million seconds (49 days) in 4OS2,
               and about 1 billion seconds (34 years!) in 4NT.

           ##  For delays shorter than one second, use the BEEP
               command with an inaudible frequency (below 20 Hz).

               4DOS, 4OS2, and 4NT use the minimum possible
               processor time during a DELAY, in order to allow
               other applications full use of system resources.

               You can cancel a delay by pressing Ctrl-C or Ctrl-
               Break.
  -219-

  DESCRIBE                                                       (New)

  Purpose:     Create, modify, or delete file and subdirectory
               descriptions.

  Format:      DESCRIBE [/A:[[-]rhsda]] file [[/D]"description"] ...

               file:  The file, directory, or list of files and
               directories to operate on.
               "description":  The description to attach to the
               file.

               /A: (Attribute select)   /D(escription follows)

  File Selection:   Supports extended wildcards, ranges, multiple
               file names, and include lists (see pages 64 - 73).
               Use extended wildcards with caution on LFN volumes;
               see page 74 for details.

  Usage:       DESCRIBE adds descriptions to files and
               subdirectories.  The descriptions can be displayed by
               DIR in single-column mode, and by SELECT.
               Descriptions let you identify your files in much more
               meaningful ways than you can in an eight-character
               filename.

               You enter a description on the command line by typing
               the DESCRIBE command, the filename, and the
               description in quotation marks, like this:

                    c:\> describe memo.txt "Memo to Bob about party"

               If you don't put a description on the command line,
               DESCRIBE will prompt you for it:

                    c:\> describe memo.txt
                    Describe "memo.txt" : Memo to Bob about party

               If you use wildcards or multiple filenames with the
               DESCRIBE command and don't include the description
               text, you will be prompted to enter a description for
               each file.  If you do include the description on the
               command line, all matching files will be given the
               same description.

               If you use DESCRIBE on an HPFS, NTFS, or LFN drive,
               you must quote the file name if it contains
               whitespace or special characters.  See page 14 for
               additional details.

               If you enter a quoted description on the command
               line, and the text matches the name of a file in the
               current directory, the command processor will treat
               the string as a quoted file name, not as description
               text as you intended.  To resolve this problem use
               the /D switch immediately prior to the quoted
               description (with no intervening spaces).  For
  -220-

               example, if the current directory contains the files
               DATA.TST and "Test File", the first of these commands
               will work as intended, but the second will not (in
               the second example the string "test file" will be
               treated as a second file name, when it is intended to
               be description text):

                    c:\> describe data.tst /D"test file"
                    c:\> describe data.tst "test file"

               On drives which support long file names you will not
               see file descriptions in a normal DIR display,
               because DIR must leave space for the long filenames.
               To view the descriptions, use DIR /Z to display the
               directory in FAT format.  See the DIR command for
               more details.

               Each description can be up to 511 characters long.
               You can change this limit with the DescriptionMax
               directive in the .INI file (see page 155).  In order
               to fit your descriptions on a single line in a
               standard DIR display, keep them to 40 characters or
               less (longer descriptions are wrapped in the DIR
               output).  DESCRIBE can edit descriptions longer than
               DescriptionMax (up to a limit of 511 characters), but
               will not allow you to lengthen the existing text.

               The descriptions are stored in each directory in a
               hidden file called DESCRIPT.ION.  Use the ATTRIB
               command to remove the hidden attribute from this file
               if you need to copy or delete it.  DESCRIPT.ION is
               always created as a hidden file, but will not be re-
               hidden by 4DOS, 4OS2, or 4NT if you remove the hidden
               attribute.

               You can change the description file name with the
               SETDOS /D command or the DescriptionName directive in
               the .INI file (page 155), and retrieve it with the
               %_DNAME internal variable (page 115).  Use caution
               when changing the description file name, as changing
               the name from the default will make it difficult to
               transfer file descriptions to another system.

               The description file is modified appropriately
               whenever you perform an internal command which
               affects it (such as COPY, MOVE, DEL, or RENAME), but
               not if you use an external program (such as XCOPY or
               a visual shell).  You can disable description
               processing on the Options 1 page of the OPTION
               dialogs, with the Descriptions directive in the .INI
               file, or with SETDOS /D.

           !   When you COPY or MOVE files between two directories,
               both of which have descriptions, and you use switches
               which enable processing of hidden files (or if you
               have removed the hidden attribute from DESCRIPT.ION),
               you must use caution to avoid overwriting existing
  -221-

               file descriptions in the destination directory with
               the DESCRIPT.ION file from the source directory.  See
               the notes under the Advanced Features sections of
               COPY and MOVE for additional details.

  Options: ##  /A:  (Attribute select): Select only those files that
               have the specified attribute(s) set.  See Attribute
               Switches on page 174 for information on the
               attributes which can follow /A:.

               /D(escription follows):  The quoted string
               immediately following this switch is a description,
               not a file name.  Use /D to avoid any ambiguity in
               the meaning of quoted strings.  See the Usage section
               above for details.
  -222-

  DETACH      [4OS2, 4NT]                                 (Compatible)

  Purpose:     Start an OS/2 or Windows NT program in detached mode.

  Format:      DETACH command

               command:  The name of a command to execute, including
               an optional drive and path specification.  The name
               must be enclosed in quotation marks if it contains
               any spaces.

               See also:  START.

  Usage:       When you start a program with DETACH, that program
               cannot use the keyboard, mouse, or video display.  It
               is "detached" from the normal means of user input and
               output.  However, you can redirect the program's
               standard I/O to other devices if necessary, using
               redirection symbols (see page 58).

               The command can be an internal command, external
               command, alias, or batch file.  4OS2 or 4NT will
               detach a copy of itself to execute the command.

               For example, the following command will detach a copy
               of the command processor to run the batch file
               XYZ.BTM:

                    [c:\] detach xyz.btm

               Once the program has started, 4OS2 or 4NT returns to
               the prompt immediately.  It does not wait for a
               detached program to finish.

               There is no standard way to stop a detached program.
               If the program does not terminate on its own you must
               reboot the system or use an appropriate task manager
               or external utility to stop it.
  -223-

  DIR                                                       (Enhanced)

  Purpose:     Display information about files and subdirectories.

  Format:      DIR [/1 /2 /4 /A[[:][-]rhsda] /B /C[HP] /D /E /F /G
               /H /I"text" /J /K /L /M /N /O[[:][-]acdeginrsu] /P /R
               /S /T[:acw] /U /V /W /X /Z] [file...]

               file:  The file, directory, or list of files or
               directories to display.

               /1  (one column)         /L(ower case)
               /2  (two columns)        /M (suppress footer)
               /4  (four columns)       /N(ormal display)
               /A(ttribute select)      /O(rder)
               /B(are)                  /P(ause)
               /C[HP] (Compression)     /R (disable wRap)
               /D(isable color coding)  /S(ubdirectories)
               /E (upper case)          /T (aTtribute) or (Time)
               /F(ull path)             /U (sUmmary information)
               /G (allocated size)      /V(ertical sort)
               /H(ide dots)             /W(ide)
               /I (match descriptions)  /X (display short names)
               /J(ustify names)         /Z (use FAT format)
               /K (suppress header)

               See also:  ATTRIB, DESCRIBE, SELECT, and SETDOS.

  File Selection:   Supports extended wildcards, ranges, multiple
               file names, and include lists (see pages 64 - 73).

  Usage:       DIR can be used to display information about files
               from one or more of your disk directories, in a wide
               range of formats.  Depending on the options chosen,
               you can display the file name, attributes, and size;
               the time and date of the last change to the file; the
               file description; and the file's compression ratio.
               You can also display information in 1, 2, 4, 5, or
               more columns, sort the files several different ways,
               use color to distinguish file types, and pause after
               each full screen.

               The various DIR displays are controlled through
               options or switches.  The best way to learn how to
               use the many options available with the DIR command
               is to experiment.  You will soon know which options
               you want to use regularly.  You can select those
               options permanently by using the ALIAS command.

               For example, to display all the files in the current
               directory, in 2 columns, sorted vertically (down one
               column then down the next), and with a pause at the
               end of each page:

                    c:\> dir /2/p/v

               To set up this format as the default, using an alias:
  -224-

                    c:\> alias dir=*dir /2/p/v

               When you use DIR on an HPFS, NTFS, or LFN drive, you
               must quote any file names which contain whitespace or
               special characters.  See page 14 for additional
               details.

               The following sections group DIR's features together
               in several categories.  Many of the sections move
               from a general discussion to more technical material.
               If you find some of the information in a category too
               detailed for your needs, feel free to skip to the
               beginning of the next section.  The sections are:

                    Selecting Files (below)
                    Default DIR Output Format (page 226)
                    Switching Formats (page 227)
                    Multiple Column Displays (page 228)
                    Color-Coded Directories (page 230)
                    Redirected Output (page 231)
                    Other Notes (page 231)
                    Options (page 232)


               Selecting Files

               DIR can display information about a single file or
               about several, dozens, hundreds, or thousands of
               files at once.  To display information about a single
               file, just add the name of the file to the DIR
               command line:

                    c:\> dir january.wks

               The simplest way to view information about several
               files at once is to use wildcards.  DIR can work with
               traditional wildcard characters (* and ?) and the
               extended wildcards described on page 64.  For example
               to display all of the .WKS files in the current
               directory:

                    c:\> dir *.wks

               To display all .TXT files whose names begin with A,
               B, or C:

                    c:\> dir [abc]*.txt

               If you don't specify a filename, DIR defaults to *.*
               on traditional FAT drives, and * on HPFS, NTFS, and
               LFN drives.  This default displays all non-hidden
               files and subdirectories in the current directory.

               If you link two or more filenames together with
               spaces, DIR will display all of the files that match
               the first name and then all of the files that match
               the second name.  You may use a different drive and
  -225-

               path for each filename.  This example lists all of
               the .WKS and then all of the .WK1 files in the
               current directory:

                    c:\> dir *.wks *.wk1

               If you use an include list (see page 73) to link
               multiple filenames, DIR will display the matching
               filenames in a single listing.  Only the first
               filename in an include list can have a path; the
               other files must be in the same path.  This example
               displays the same files as the previous example, but
               the .WKS and .WK1 files are intermixed:

                    c:\> dir *.wks;*.wk1

               You can include files in the current or named
               directory plus all of its subdirectories by using the
               /S option.  This example displays all of the .WKS and
               .WK1 files in the D:\DATA directory and each of its
               subdirectories:

                    c:\> dir /s d:\data\*.wks;*.wk1

               You can also select files by their attributes by
               using the /A option.  For example, this command
               displays the names of all of the subdirectories of
               the current directory:

                    c:\> dir /a:d

               Finally, with the /I option, DIR can select files to
               display based on their descriptions (see the DESCRIBE
               command on page 219 for more information on file
               descriptions).  DIR will display a file if its
               description matches the text after the /I switch.
               The search is not case sensitive.  You can use
               wildcards and extended wildcards as part of the text.
               For example, to display any file described as a "Test
               File" you can use this command:

                    c:\> dir /i"test file"

               If you want to display files that include the words
               "test file" anywhere in their descriptions, use
               extended wildcards like this:

                    c:\> dir /i"*test file*"

               To display only those files which do not have
               descriptions, use:

                    c:\> dir /I"[]"

               In addition, you can use ranges (see page 67) to
               select or exclude specific sets of files.  For
               example, to display all files modified in the last
  -226-

               week, all files except those with a .BAK extension,
               and all files over 500 KB in size:

                    c:\> dir /[d-7]
                    c:\> dir /[!*.bak]
                    c:\> dir /[s500K]

               You can, of course, mix any of these file selection
               techniques in whatever ways suit your needs.


               Default DIR Output Format

               DIR's output varies based on the type of volume or
               drive on which the files are stored.  If the volume
               supports long file names (HPFS volumes, NTFS volumes,
               and VFAT volumes under Windows 95 or Windows NT), the
               default DIR format contains 4 columns: the date of
               the last file modification or write, the time of last
               write, the file size in bytes, and the file name.
               The name is displayed as it is stored on the disk, in
               upper, lower, or mixed case.  DIR will wrap filenames
               from one line to the next if they are too long to fit
               the width of the display.  The standard output format
               is:

                  Volume in drive C is C - BOOTUP    Serial ...
                  Directory of  C:\4DOS60\*.*

                 10-24-96  12:17         <DIR>    .
                 10-24-96  12:17         <DIR>    ..
                 10-28-96   7:57             967  4dos 6.pif
                 10-21-96  18:08         212,854  4DOS.COM
                 11-02-96  10:08              45  4DOS.INI

               (See Switching Formats below for information on
               changing the standard long filename format to allow
               room for file descriptions.)

               On FAT volumes which do not support long file names,
               the default DIR format contains 5 columns: the file
               name, the file size in bytes, the date of the last
               write, the time of the last write, and the file's
               description.  File names are listed in lower-case;
               directory names in upper case:

                  Volume in drive C is C - BOOTUP    Serial ...
                  Directory of  C:\4DOS60\*.*

                 .            <DIR>     10-24-96  12:17
                 ..           <DIR>     10-24-96  12:17
                 TEST         <DIR>     11-01-96  16:21
                 4dos6.pif         967  10-28-96   7:57 4DOS PIF
                 file
                 4dos.com       212854  10-21-96  18:08 4DOS exe ...
                 4dos.ini           45  11-02-96  10:08 4DOS conf
                 ...
  -227-

               DIR's output is normally sorted by name, with
               directories listed first.  You can change the sort
               order with the /O option.  For example, these two
               commands sort the output by date -- the first command
               lists the oldest file first; the second command lists
               the oldest file last:

                    c:\> dir /o:d
                    c:\> dir /o:-d

               When displaying file descriptions, DIR wraps long
               lines to fit on the screen.  DIR displays a maximum
               of 40 characters of text in each line of a
               description, unless your screen width allows a wider
               display.  If you disable description wrapping with
               the /R option, the description is truncated at the
               right edge of the screen, and a right arrow [a] is
               added at the end of the line to alert you to the
               existence of additional description text.

               Regardless of the volume type, DIR's default output
               is sorted.  It displays directory names first, with
               "<DIR>" inserted instead of a file size, and then
               filenames.  DIR assumes that sequences of digits
               should be sorted numerically (for example, the file
               DRAW2 is listed before DRAW03 because 2 is
               numerically smaller than 03), rather than strictly
               alphabetically (where DRAW2 would come second because
               "2" is after "0" in alphanumeric order).  You can
               change the sort order with the /O option.  When DIR
               displays file names in a multi-column format, it
               sorts file names horizontally unless you use the /V
               option to display vertically sorted output.

               DIR's display can be modified in many ways to meet
               different needs.  Most of the following sections
               describes the various ways you can change DIR's
               output format.


               Switching Formats

               On volumes which support long file names, you can
               force DIR to use a FAT-like format (file name first,
               followed by file information) with the /Z option.  If
               necessary, DIR /Z truncates long file names on LFN,
               HPFS, and NTFS drives, and adds a right arrow [a] to
               show that the name contains additional characters.

               The standard LFN output format does not provide
               enough space to show descriptions along with file
               names.  Therefore, if you wish to view file
               descriptions as part of the DIR listing on a volume
               which supports long file names, you must use the /Z
               option.
  -228-

               4DOS and 4NT will display the alternate, short file
               names for files with long file names if you use the
               /X option.  Used alone, /X causes DIR to display
               names in 2 columns after the size, time, and date:
               one column for alternate or short file names and the
               other for long file names.  If a file does not have a
               short or alternate name which is different from the
               long filename, the first filename column is empty.
               4OS2 does not support the /X option because, on HPFS
               volumes, files with long names do not have alternate,
               short forms.

               If you use /X and /Z together under 4DOS or 4NT, DIR
               will display the short or alternate file names in the
               FAT-style display format.

               If you use the /B option, DIR displays just file
               names and omits the file size, time stamp, and
               description for each file, for example:

                    c:\> dir w* /b
                    WINDOWS
                    WINNT
                    win311
                    WINALIAS
                    WINENV.BTM
                    .....

               There are several ways to modify the display produced
               by /B.  The /F option is similar to /B, but displays
               the full path and name of each file, instead of just
               its name.  To view the same information for a
               directory and its subdirectories use /B /S or /F /S.
               Under 4DOS and 4NT you can use /B /X to display the
               short name of each file, with no additional
               information.  To display the short version of both
               the path and file name for each file, use /F /X.  For
               example:

                    c:\> dir /x/f/s *.pif
                    C:\MACH64\INSTALL.PIF
                    C:\PROGRA~1\WINZIP\WZ.PIF
                    C:\WINDOWS\DOSPRMPT.PIF
                    C:\WINDOWS\STARTM~1\APPS&U~1\INFOSE~1.PIF
                    C:\WINDOWS\STARTM~1\PROMPTS\4DOS.PIF
                    C:\WINDOWS\STARTM~1\PROMPTS\TOCP.PIF
                    C:\WINDOWS\STARTM~1\PROMPTS\SPECIAL\4DOS(R~1.PIF
                    .....


               Multiple Column Displays

               DIR has three options, /2, /4, and /W, that create
               multi-column displays.

               The /2 option creates a 2-column display.  On drives
               which support long filenames, only the name of each
   -229-

               file is displayed, with directory names placed in
               square brackets to distinguish them from file names.
               On drives which do not support long filenames, or
               when /Z or /X is used (see below), the display
               includes the name, file size, and time stamp for each
               file.

               The /4 option is similar to /2, but displays
               directory information in 4 columns.  On drives which
               do not support long filenames, or when /Z or /X is
               used (see below), the display shows the file name and
               the file size in kilobytes (KB) or megabytes (MB),
               with "<D>" in the size column for directories.

               The /W option displays directory information in 5 or
               more columns, depending on your screen width.  Each
               entry in a DIR /W display contains either the name of
               a file or the name of a directory.  Directory names
               are placed in square brackets to distinguish them
               from file names.

               If you use one of these options on a drive that
               supports long file names, and do not select an
               alternate display format with /Z or /X, the actual
               number of columns will be based on the longest name
               to be displayed and your screen width, and may be
               less than the number you requested (for example, you
               might see only three columns even though you used
               /4).  If the longest name is too long to fit in on a
               single line the display will be reduced to one
               column, and each name will be wrapped, with "extra"
               blank lines added so that each name takes the same
               number of lines.

               On LFN drives you can use /Z with any of the multi-
               column options to create a traditional FAT-format
               display, with long names truncated to fit in the
               available space.  If you use /X, the traditional FAT-
               format display is also used, but short names are
               displayed (rather than truncated long names).  The
               following table summarizes the effects of different
               options on LFN drives:

                                        Display Columns

                 Format  Normal         /2 or /4       /W


                 Normal  1 column,      2 - 4          No. of
                         long names     columns, long  columns based
                         plus size,     names only     on longest
                         date, time                    name, long
                                                       names only

                 /Z      1 column,      2 - 4          5+ columns,
                         truncated      columns,       truncated
                         long names     truncated      long names
   -230-

                         plus size,     long names     only
                         date, time     plus other
                                        info

                 /X      1 column,      2 - 4          5+ columns,
                         both names     columns,       short names
                         plus size,     short names    only
                         date, time     plus other
                                        info

                 /Z /X   1 column,      (Same as /X    (Same as /X
                         short names    alone)         alone)
                         plus size,
                         date, time


               Color-Coded Directories

               The DIR command can display each file name and the
               associated file information in a different color,
               depending on the file's extension.

               To choose the display colors, you must either use the
               SET command to create an environment variable called
               COLORDIR, or use the Commands page of the OPTION
               dialogs or a text editor to set the ColorDir
               directive in your .INI file.  If you do not use the
               COLORDIR variable or the ColorDir directive, DIR will
               use the default screen colors for all files.

               If you use both the COLORDIR variable and the
               ColorDir directive, the environment variable will
               override the settings in your .INI file.  You may
               find it useful to use the COLORDIR variable for
               experimenting, then to set permanent directory colors
               with the ColorDir directive.

               The format for both the COLORDIR environment variable
               and the ColorDir directive in the .INI file is:

                    ext ... :ColorName; ...

               where "ext" is a file extension (which may include
               wildcards) or one of the following file types:

                    DIRS      Directories
                    RDONLY    Read-only files
                    HIDDEN    Hidden files
                    SYSTEM    System files
                    ARCHIVE   Files modified since the last backup

               and "ColorName" is any valid color name (see page 27
               for information on color names).

               Unlike most color specifications, the background
               portion of the color name may be omitted for
               directory colors.  If you don't specify a background
  -231-

               color, DIR will use the current screen background
               color.

               For example, to display the .COM and .EXE files in
               red on the current background, the .C and .ASM files
               in bright cyan on the current background, and the
               read-only files in blinking green on white (this
               should be entered on one line):

                    c:\> set colordir=com exe:red; c asm:bright
                         cyan; rdonly:blink green on white

               Extended wildcards can be used in directory color
               specifications (see page 64 for more information on
               extended wildcards).  For example, to display .BAK,
               .BAX, and .BAC files in red:

                    c:\> set colordir=BA[KXC]:red


               Redirected Output

               The output of the DIR command, like that of most
               other internal commands, can be redirected to a file,
               printer, serial port, or other device.  However, you
               may need to take certain DIR command options into
               account when you redirect DIR's output.

               DIR wraps both long file names and file descriptions
               at the width of your display.  Its redirected output
               will also wrap at the screen width.  Use the /R
               option if you wish to disable wrapping of long
               descriptions.

               If you redirect a color-coded directory to a file,
               DIR will remove the color data as it sends the
               directory information to a file.  It will usually do
               the same if you redirect output to a character device
               such as a printer or serial port.  However, it is not
               always possible for DIR to tell whether or not a
               device is a character device.  If you notice that
               non-colored lines are being sent to the output device
               and colored lines are appearing on your screen, you
               can use the /D option to temporarily disable color-
               coding when you redirect DIR's output.

               To redirect DIR output to the clipboard, use CLIP: as
               the output device name, for example:

                    c:\> dir *.exe > clip:


           ##  Other Notes

               If you have selected a specific country code for your
               system, DIR will display the date in the format for
               that country.  The default date format is U.S. (mm-
  -232-

               dd-yy).  The separator character in the file time
               will also be affected by the country code.  Thousands
               and decimal separators in numeric displays are
               affected by the country code, and by the
               ThousandsChar and DecimalChar settings selected on
               the Options 1 page of the OPTION dialogs, or in the
               .INI file (see pages 155 and 159).

       4DOS,   If you are using a disk compression program, you can
       4NT     use the /C switch to view the amount of compression
               achieved for each file.  When you do, the compression
               ratio is displayed instead of the file's description.
               You can also sort the display by compression ratios
               with the /O:c switch.  Details for both switches are
               in the Options section, below.  Under 4DOS, only the
               compression programs distributed with MS-DOS and
               Windows 95 (DRVSPACE and DBLSPACE) are supported.  /C
               and /O:c will be ignored for other compression
               programs, and on uncompressed drives.  /C will not
               display compression ratios on LFN drives unless you
               also use /Z to switch to the traditional short
               filename format.

       4DOS    DIR can handle directories of any size, limited only
               by available memory.  Under 4DOS, each short filename
               requires 64 bytes of memory, plus the size of the
               description (if any).  For example, a system with
               just 128K of free memory can display up to about
               2,000 files per directory.  Long filenames require
               additional space roughly equal to the length of the
               long names to be displayed.  Additional space is also
               required when using DIR /S, particularly on LFN
               drives with long directory names and/or deeply-nested
               directories.  Memory requirements for DIR are
               generally not a concern under 4OS2 and 4NT, because
               of the virtual memory available under these operating
               systems.

       4DOS    DOS networks with large server volumes (over 2 GB)
               may report incorrect free disk space values at the
               end of the DIR display.  If this occurs, it is
               because the network software does not report proper
               or usable values to 4DOS.

  Options:     Options on the command line apply only to the
               filenames which follow the option, and options at the
               end of the line apply to the preceding filename only.
               This allows you to specify different options for
               different groups of files, yet retains compatibility
               with the traditional DIR command when a single
               filename is specified.

               /1:  Single column display -- display the filename,
               size, date, and time; also displays the description
               on drives which do not support long filenames.  This
               is the default.  If /T is used the attributes are
               displayed instead of the description; if /C or /O:c
  -233-

               is used the compression ratio is displayed instead of
               the description.  This option is most useful if you
               wish to override a default /2, /4, or /W setting
               stored in an alias.

               /2:  Two column display -- display just the name (on
               LFN, HPFS, and NTFS drives), or display the filename,
               size, date, and time on other drives.  See Multiple
               Column Displays on page 228 for more details.

               /4:  Four column display -- display just the name (on
               LFN, HPFS, and NTFS drives); or display the filename
               and size, in K (kilobytes) or M (megabytes) on other
               drives, with files between 1 and 9.9 megabytes in
               size displayed in tenths (i.e., "2.4M").  See
               Multiple Column Displays on page 228 for more
               details.

           ##  /A(ttribute select): Display only those files that
               have the specified attribute(s) set.  See Attribute
               Switches on page 174 for information on the
               attributes which can follow /A.

           ##  /B(are):  Suppress the header and summary lines, and
               display file or subdirectory names only, in a single
               column.  This option is most useful when you want to
               redirect a list of names to a file or another
               program.  If you use /B with /S, DIR will show the
               full path of each file (the same display as /F)
               instead of simply its name and extension.  If you use
               /B with /X on an LFN or NTFS drive, DIR will display
               the short name of each file instead of the long name.

       4DOS,   /C(ompression):  Display per-file and total
       4NT     compression ratio on compressed drives.  The
               compression ratio is displayed instead of the file
               description or attributes.  The ratio is left blank
               for directories and files with a length of 0 bytes,
               and for files on non-compressed drives.  /C only
               works in single-column mode; it is ignored if /2, /4,
               or /W is used.  The compression ratios will not be
               visible on LFN or NTFS drives unless you use /Z to
               switch to the traditional short filename format.

               Under 4DOS, only the compression programs distributed
               with MS-DOS and Windows 95 (DRVSPACE and DBLSPACE)
               are supported.  Under 4NT, only compressed NTFS
               drives are supported.

               The numerator of the displayed compression ratio is
               the amount of space which would be allocated to the
               file if the compression utility were not in use,
               based on the compressed drive's cluster size (usually
               8K bytes).  The denominator is the space actually
               allocated for the compressed file.  For example, if a
               file is allocated 6,144 bytes when compressed, and
               would require 8,192 bytes if uncompressed, the
  -234-

               displayed compression ratio would be 8,192 / 6,144,
               or 1.3 to 1.

       4DOS    Using /CH displays compression ratios like /C, but
               bases the calculation on the host drive's cluster
               size.  This gives a more accurate picture of the
               space saved through compression than is given by /C.
               This option will occasionally display compression
               ratios slightly less than 1.0 for files which have
               actually expanded when stored on the compressed
               drive.

       4DOS    If /CP is used instead of /C, the compression is
               displayed as a percentage (e.g., 33%) instead of a
               ratio (e.g., 3 to 1).  If /CHP is used instead of
               /CH, the host compression is displayed as a
               percentage.  The /CHP option must be entered as
               shown; you can not use /CPH.

           ##  /D(isable color coding):  Temporarily disable
               directory color coding.  May be required when color-
               coded directories are used and DIR output is
               redirected to a character device like the printer
               (e.g., PRN or LPT1) or serial port (e.g., COM1 or
               COM2).  /D is not required when DIR output is
               redirected to a file.

               /E:  Display filenames in the traditional upper case;
               also see SETDOS /U (page 367) and the UpperCase
               directive in 4DOS.INI (page 159).

           ##  /F(ull path):  Display each filename with its drive
               letter and path in a single column, without other
               information.  If you use /F with /X on a volume which
               supports long filenames, the "short" version of the
               entire path is displayed.

               /G:  Display the allocated disk space instead of the
               actual size of each file.

               /H(ide dots):  Suppress the display of the "." and
               ".." directories.

               /I:  Display filenames by matching text in their
               descriptions.  The text can include wildcards and
               extended wildcards.  The search text must be enclosed
               in quotation marks.  You can select all filenames
               that have a description with /I"[?]*", or all
               filenames that do not have a description with /I"[]".

               The /I option may be used to select files even if
               descriptions are not displayed (for example, if /2 is
               used).  However, /I will be ignored if /C or /O:c is
               used.
  -235-

               /J(ustify names):  Justify (align) filename
               extensions and display them in the traditional
               format.

           ##  /K:  Suppress the header (disk and directory name)
               display.

               /L(ower case):  Display file and directory names in
               lower case; also see SETDOS /U (page 367) and the
               UpperCase directive in 4DOS.INI (page 159).

           ##  /M:  Suppress the footer (file and byte count totals)
               display.

       4DOS    /N:  Reset the DIR options to the default values.
               This is useful when you want to display some files in
               one format, and then change back to the defaults for
               another set of files.

       4OS2,   /N:  Use the long filename display format, even if
       4NT     the files are stored on a volume which does not
               support long names.  See also /Z.

               /O(rder):  Set the sorting order.  You may use any
               combination of the following sorting options; if
               multiple options are used, the listing will be sorted
               with the first sort option as the primary key, the
               next as the secondary key, and so on:

                    -    Reverse the sort order for the next option

                    a    Sort names and extensions in standard ASCII
                         order, rather than sorting numerically when
                         digits are included in the name or
                         extension.

       4DOS,        c    Sort by compression ratio (the least
       4NT               compressed file in the list will be
                         displayed first).  For single-column
                         directory displays in the traditional short
                         filename format, the compression ratios
                         will be used as the basis of the sort and
                         will also be displayed.  For wider displays
                         (/2, /4, and /W) and displays in LFN
                         format, the compression ratios will be used
                         to determine the order but will not be
                         displayed.  Under 4DOS, if /O:c is used
                         with /CH or /CHP the sort will be based on
                         the host-drive compression ratios.  For
                         information on supported compression
                         systems see /C above.

                    d    Sort by date and time (oldest first); for
                         drives which support long file names, also
                         see /T.

                    e    Sort by extension.
  -236-

                    g    Group subdirectories first, then files.

                    i    Sort by the file description (ignored if /C
                         or /O:c is also used).

                    n    Sort by filename (this is the default).

                    r    Reverse the sort order for all options.

                    s    Sort by size.

                    u    Unsorted.

               /P(ause):  Wait for a key to be pressed after each
               screen page before continuing the display.  Your
               options at the prompt are explained in detail on page
               50.

               /R  (disable wRap):  Forces long descriptions to be
               displayed on a single line, rather than wrapped onto
               two or more lines.  Use /R when output is redirected
               to a character device, such as a serial port or the
               printer; or when you want descriptions truncated,
               rather than wrapped, in the on-screen display.

               /S(ubdirectories):  Display file information from the
               current directory and all of its subdirectories.  DIR
               will only display headers and summaries for those
               directories which contain files that match the
               filename(s), ranges, and attributes that you specify.

           ##  /T  (aTtribute display):  Display the filenames and
               attributes.  /T is ignored if /C or /O:c is also
               used.  The attributes are displayed in the format
               RHDSA, where:

                    R   Read-only       S   System
                    H   Hidden          A   Archive
                    D   Directory

               On drives which support long file names, if you wish
               to add another option after /T, you must start the
               next option with a forward slash.  If you don't, the
               command processor will interpret the /T as the /T:acw
               time display switch (see below) and the following
               character as a time selector.  For example:

                    c:\> dir /tz     incorrect, will display error
                    c:\> dir /t/z    correct

               /T:acw (Time display): Specify which of the date and
               time fields on an LFN, NTFS, or HPFS drive should be
               displayed and used for sorting:

                    a    Last access date and time (access time is
                         not saved on LFN volumes).
  -237-

                    c    Creation date and time.

                    w    Last write date and time (default).

               See page 16 for more information on file dates and
               times on LFN, HPFS, and NTFS drives.

               /U  (sUmmary information):  Only display the number
               of files, the total file size, and the total amount
               of disk space used.  Information on individual files
               is not displayed.

               /V(ertical sort):  Display the filenames sorted
               vertically rather than horizontally (use with the /2,
               /4 or /W options).

               /W(ide):  Display filenames only, horizontally across
               the screen. On drives which do not support long
               filenames, or when used with /Z or /X under 4DOS or
               4NT, /W displays as many columns as it can fit into
               the command processor window, using 16 characters in
               each column. Otherwise (i.e., when long filenames are
               displayed) the number of columns depends on the width
               of the longest name in the listing.  See Multiple
               Column Displays on page 228 for more details.

       4DOS,   /X:  Display both the short name (8-character name
       4NT     plus 3-character extension) and the long name of each
               file on an LFN or NTFS drive.  In normal single-
               column output the short name is displayed first,
               followed by the long name.  The short name column is
               left blank if the short name and long name are the
               same.  /X also selects short filenames in the /2, /4,
               /B, /W, and /Z displays, and short file and path
               names in the /F display.

               /Z:  Display a directory on an HPFS, NTFS, or LFN
               drive in the traditional FAT format, with the
               filename at the left and the description at the
               right.  Long names will be truncated to 12 characters
               unless /X is also used; if the name is longer than 12
               characters, it will be followed by a right arrow [a]
               to show that one or more characters have been
               truncated.
  -238-

  DIRHISTORY                                                     (New)

  Purpose:     Display, add to, clear, or read the directory history
               list.

  Format:      DIRHISTORY [/A directory /F /P /R filename]

               directory:  The name of a directory to be added to
               the directory history.
               filename:  The name of a file containing entries to
               be added to the directory history.

               /A(dd)                   /P(ause)
               /F(ree)                  /R(ead)

               See also:  HISTORY.

  Usage:       Every time you change to a new directory or drive,
               4DOS, 4OS2, and 4NT record the current directory in
               an internal directory history list.  See page 46 for
               information on directory history window, which allows
               you to use the list to return to a previous
               directory.  See page 51 for general information on
               directory navigation.

               The DIRHISTORY command lets you view and manipulate
               the directory history list directly.  If no
               parameters are entered, DIRHISTORY will display the
               current directory history list:

                    c:\> dirhistory

               With the options explained below, you can clear the
               list, add new directories to the list without
               changing to them, save the list in a file, or read a
               new list from a file.

               The number of directories saved in the directory
               history list depends on the length of each directory
               name.  The list size can be specified at startup from
               256 to 2048 characters in 4DOS, or 256 to 32767
               characters in 4OS2 and 4NT by using the DirHistory
               directive in the .INI file (see page 148).  The
               default size is 256 characters.

               Your directory history list can be stored either
               locally (a separate history list for each copy of the
               command processor) or globally (all copies of the
               command processor share the same list).  For full
               details see the discussion of local and global
               directory history lists beginning on page 47.

               You can save the directory history list by
               redirecting the output of DIRHISTORY to a file.  This
               example saves the history to a file called DIRHIST
               and reads it back again:
  -239-

                    c:\> dirhistory > dirhist
                        .....
                    c:\> dirhistory /r dirhist

               Because the directory history stores each name only
               once, you don't have to delete its contents before
               reading back the file unless you want to delete the
               directories that were visited by the intervening
               commands.

               If you need to save your directory history at the end
               of each day's work, you might use commands like this
               in your AUTOEXEC.BAT or other startup file:

                    if exist c:\dirhist dirhistory /r c:\dirhist
                    alias shut*down `dirhistory > c:\dirhist`

               This restores the previous history list if it exists,
               then defines an alias which will allow you to save
               the history before shutting off the system.

  Options: ##  /A(dd):  Add a directory to the directory history
               list.

               /F(ree):  Erase all entries in the directory history
               list.

               /P(rompt):  Wait for a key after displaying each page
               of the list.  Your options at the prompt are
               explained in detail on page 50.

           ##  /R(ead):  Read the directory history from the
               specified file and append it to the list currently
               held in memory.
  -240-

  DIRS                                                           (New)

  Purpose:     Display the current directory stack.

  Format:      DIRS

               See also:  PUSHD, POPD, and Directory Navigation on
               page 51.

  Usage:       The PUSHD command adds the current default drive and
               directory to the directory stack, a list that 4DOS,
               4OS2, and 4NT maintain in memory.  The POPD command
               removes the top entry of the directory stack and
               makes that drive and directory the new default.  The
               DIRS command displays the contents of the directory
               stack, with the most recent entries on top (i.e., the
               next POPD will retrieve the first entry that DIRS
               displays).

               For example, to change directories and then display
               the directory stack:

                    c:\> pushd c:\database
                    c:\database> pushd d:\wordp\memos
                    d:\wordp\memos> dirs
                    c:\database
                    c:\

               The directory stack holds 511 characters, enough for
               20 to 40 typical drive and directory entries.
  -241-

  DO                                                             (New)

  Purpose:     Create loops in batch files.

  Format:      DO [n | FOREVER]
                    or
               DO varname = start TO end [BY n]
                    or
               DO [WHILE | UNTIL] condition
                    or
               DO varname IN [@]set
                    commands
               [ITERATE]
               [LEAVE]
                    commands
               ENDDO

               varname:  The environment variable that will hold the
               loop counter, filename, or line from a file.
               n, start, end:  Integers between 0 and 2,147,483,647
               inclusive, or internal variables or variable
               functions that evaluate to such a value.
               condition:  A test to determine if the loop should be
               executed.
               set:  A set of values for the variable.
               commands:  One or more commands to execute each time
               through the loop.  If you use multiple commands, they
               must be separated by command separators or be placed
               on separate lines.

  File Selection:   Supports extended wildcards, ranges, and include
               lists for the set (see pages 64 - 73).

  Usage:       DO can only be used in batch files.

               DO can be used to create 4 different kinds of loops.
               The first, introduced by DO n, is a counted loop.
               The batch file lines between DO and ENDDO are
               repeated n times.  For example:

                    do 5
                      beep
                    enddo

               You can also specify "forever" for n if you wish to
               create an endless loop (you can use LEAVE or GOTO to
               exit such a loop; see below for details).

               The second type of loop is similar to a "for loop" in
               programming languages like BASIC.  DO creates an
               environment variable, varname, and sets it equal to
               the value start (if varname already exists in the
               environment, it will be overwritten).  DO then begins
               the loop process by comparing the value of varname
               with the value of end.  If varname is less than or
               equal to end, DO executes the batch file lines up to
               the ENDDO.  Next, DO adds 1 to the value of varname,
  -242-

               or adds the value n if BY n is specified, and repeats
               the compare and execute process until varname is
               greater than end.  This example displays the even
               numbers from 2 through 20:

                    do i = 2 to 20 by 2
                      echo %i
                    enddo

               DO can also count down, rather than up.  If n is
               negative, varname will decrease by n with each loop,
               and the loop will stop when varname is less than end.
               For example, to display the even numbers from 2
               through 20 in reverse order, replace the first line
               of the example above with:

                    do i = 20 to 2 by -2

               The third type of loop is called a "while loop" or
               "until loop."  DO evaluates the condition, which can
               be any of the tests supported by the IF command (see
               page 284), and executes the lines between DO and
               ENDDO as long as the condition is true.  The loop
               ends when the condition becomes false.

               WHILE tests the condition at the start of the loop.
               Therefore, if the condition is false when the loop
               starts, the statements within the loop will never be
               executed, and the batch file will continue with the
               statement after the ENDDO.

               UNTIL tests the condition at the end of the loop.
               Therefore, if the condition is false when the loop
               starts, the statements within the loop will still be
               executed at least once.

               The fourth type of loop executes the lines between DO
               and ENDDO once for every member of a set (this is
               similar to the set used in the FOR command, see page
               263).  Normally, the set is a list of files specified
               with wildcards.  For example:

                    do x in *.txt

               will execute the loop once for every .TXT file in the
               current directory; each time through the loop the
               variable x will be set to the name of the next file
               that matches the file specification.

           ##  If, between DO and ENDDO, you create a new file that
               could be included in the list of files, it may or may
               not appear in an iteration of the DO loop.  Whether
               the new file appears depends on its physical location
               in the directory structure, a condition over which
               4DOS, 4OS2, and 4NT have no control.
  -243-

               You can also execute the loop once for each line of
               text in a file by placing an [@] in front of the file
               name.  If you have a file called DRIVES.TXT that
               contains a list of drives on your computer, one drive
               name per line, you can execute the loop once for each
               drive this way:

                    do x in @drives.txt

               To execute the loop once for each line of text in the
               clipboard, use CLIP: as the file name (e.g. DO X IN
               @CLIP:).  CLIP: will not return any data unless the
               clipboard contains text.  See page 58 for additional
               information on CLIP:, including details on when you
               can use the clipboard under 4DOS.

               Two special commands, ITERATE and LEAVE, can be used
               inside a DO / ENDDO loop.  ITERATE ignores the
               remaining lines inside the loop and returns to the
               beginning of loop for another iteration (unless DO
               determines that the loop is finished).  LEAVE exits
               from the current DO loop and continues with the line
               following ENDDO.  Both ITERATE and LEAVE are most
               often used in an IF or IFF command (see pages 284 and
               291):

                    do while "%var" != "%var1"
                      ...
                      if "%var" == "%val2" leave
                    enddo

               You can nest DO loops up to 15 levels deep.

               The DO and ENDDO commands must be on separate lines,
               and cannot be placed within a command group (see page
               81), or on the same line as other commands (this is
               the reason DO cannot be used in aliases).  However,
               commands within the DO loop can use command groups or
               the command separator in the normal way.

      4DOS !   If you receive a stack overflow error when using DO
               in complex, nested command sequences, see the notes
               under the StackSize directive on page 167.

           !## You can exit from all DO / ENDDO loops by using GOTO
               to a line past the last ENDDO.  However, be sure to
               read the cautionary notes about GOTO and DO under the
               GOTO command (page 279) before using a GOTO in any
               other way inside any DO loop.
  -244-

  DPATH    [4OS2]                                         (Compatible)

  Purpose:     Specify the subdirectories which applications will
               search to find files that are not in the current
               directory.

  Format:      DPATH [directory[;directory...]]

               directory:  The full name of a directory to include
               in the DPATH (data path) setting.

               See also:  PATH, SET, and ESET.

  Usage:       When most OS/2 applications try to open a data file,
               they look for the file in the current directory
               first.  If they fail to find the file there, they may
               search each of the directories in the DPATH setting
               in the order that they are included.  Internal
               commands like TYPE do not search the DPATH
               directories for files.

               For example, the following DPATH command directs
               applications to look for files in this order:  the
               current directory, the INIT directory on C, and the
               CONFIG directory on D:

                    [c:\] dpath c:\init;d:\config

               The listing of directories to be searched can be set
               or viewed with DPATH.  The list is stored as an
               environment string with the variable name DPATH, and
               can also be set or viewed with the SET command and
               edited with the ESET command.

               Directory names in the DPATH must be separated with
               semicolons [;].  4OS2 will not shift directory names
               in the DPATH to upper case as they do with those in
               the PATH setting.  If you want the names in the DPATH
               to be in upper case you must enter them that way.

               If you enter DPATH with no parameters, 4OS2 displays
               the current DPATH search list.
  -245-

  DRAWBOX                                                        (New)

  Purpose:     Draw a box on the screen.

  Format:      DRAWBOX ulrow ulcol lrrow lrcol style [BRIght]
               [BLInk]
                    fg ON [BRIght] bg [FILl [BRIght] bgfill] [ZOOm]
               [SHAdow]

               ulrow:  Row for upper left corner
               ulcol:  Column for upper left corner
               lrrow:  Row for lower right corner
               lrcol:  Column for lower right corner
               style:  Box drawing style:
                    0 No lines (box is drawn with blanks)
                    1 Single line
                    2 Double line
                    3 Single line on top and bottom, double on sides
                    4 Double line on top and bottom, single on sides
               fg:  Foreground character color
               bg:  Background character color
               bgfill:  Background fill color (for the inside of the
               box)

               See also:  DRAWHLINE and DRAWVLINE.

  Usage:       DRAWBOX is useful for creating attractive screen
               displays in batch files.

               For example, to draw a box around the edge of an
               80x25 screen with bright white lines on a blue
               background:

                    drawbox 0 0 24 79 1 bri whi on blu fill blu

               See page 27 for details about colors and color names,
               and notes on the use of bright background colors.

               If you use ZOOM, the box appears to grow in steps to
               its final size.  The speed of the zoom operation
               depends on the speed of your computer and video
               system.

               If you use SHADOW, a drop shadow is created by
               changing the characters in the row under the box and
               the 2 columns to the right of the box to normal
               intensity text with a black background (this will
               make characters displayed in black disappear
               entirely).

               The row and column values are zero-based, so on a
               standard 25 line by 80 column display, valid rows are
               0 - 24 and valid columns are 0 - 79.

               DRAWBOX checks for valid row and column values, and
               displays a "Usage" error message if any values are
               out of range.
  -246-

               Unlike DRAWHLINE and DRAWVLINE, DRAWBOX does not
               automatically connect boxes to existing lines on the
               screen with the proper connector characters.  If you
               want to draw lines inside a box and have the proper
               connectors drawn automatically, draw the box first,
               then use DRAWHLINE and DRAWVLINE to draw the lines.

               DRAWBOX uses the standard line and box drawing
               characters in the U.S. English extended ASCII
               character set.  If your system is configured for a
               different country or language, or a font which does
               not include these characters, the box may not appear
               on your screen as you expect.

       4DOS ## DRAWBOX normally writes text directly to the screen.
               If you have an unusual display adapter which does not
               support direct video output, see the OutputBIOS
               directive on page 167.
  -247-

  DRAWHLINE                                                      (New)

  Purpose:     Draw a horizontal line on the screen.

  Format:      DRAWHLINE row column len style [BRIght] [BLInk]
                    fg ON [BRIght] bg

               row:  Starting row
               column:  Starting column
               len:  Length of line
               style:  Line drawing style:  1 for single line, 2 for
               double line.
               fg:  Foreground character color
               bg:  Background character color

               See also:  DRAWBOX and DRAWVLINE.

  Usage:       DRAWHLINE is useful for creating attractive screen
               displays in batch files.  It detects other lines and
               boxes on the display, and creates the appropriate
               connector characters when possible (not all types of
               lines can be connected with the available
               characters).

               For example, the following command draws a double
               line along the top row of the display with green
               characters on a blue background:

                    drawhline 0 0 80 2 green on blue

               The row and column values are zero-based, so on a
               standard 25 line by 80 column display, valid rows are
               0 - 24 and valid columns are 0 - 79.  DRAWHLINE
               checks for a valid row and column, and displays a
               "Usage" error message if either value is out of
               range.

               See page 27 for details about colors and color names,
               and notes on the use of bright background colors.

               DRAWHLINE uses the standard line and box drawing
               characters in the U.S. English extended ASCII
               character set.  If your system is configured for a
               different country or language, or a font which does
               not include these characters, the line may not appear
               on your screen as you expect.

       4DOS ## DRAWHLINE normally writes text directly to the
               screen.  If you have an unusual display adapter which
               does not support direct video output, see the
               OutputBIOS directive on page 167.
  -248-

  DRAWVLINE                                                      (New)

  Purpose:     Draw a vertical line on the screen.

  Format:      DRAWVLINE row column len style [BRIght][BLInk]
                    fg ON [BRIght] bg

               row:  Starting row
               column:  Starting column
               len:  Length of line
               style:  Line drawing style:  1 for single line, 2 for
               double line.
               fg:  Foreground character color
               bg:  Background character color

               See also:  DRAWBOX and DRAWHLINE.

  Usage:       DRAWVLINE is useful for creating attractive screen
               displays in batch files.  It detects other lines and
               boxes on the display, and creates the appropriate
               connector characters when possible (not all types of
               lines can be connected with the available
               characters).

               For example, to draw a double width line along the
               left margin of the display with bright red characters
               on a black background:

                    drawvline 0 0 25 2 bright red on black

               The row and column values are zero-based, so on a
               standard 25 line by 80 column display, valid rows are
               0 - 24 and valid columns are 0 - 79.  DRAWVLINE
               checks for a valid row and column, and displays a
               "Usage" error message if either value is out of
               range.

               See page 27 for details about colors and color names,
               and notes on the use of bright background colors.

               DRAWVLINE uses the standard line and box drawing
               characters in the U.S. English extended ASCII
               character set.  If your system is configured for a
               different country or language, or a font which does
               not include these characters, the line may not appear
               on your screen as you expect.

       4DOS ## DRAWVLINE normally writes text directly to the
               screen.  If you have an unusual display adapter which
               does not support direct video output, see the
               OutputBIOS directive on page 167.
  -249-

  ECHO and ECHOERR                                    (Enhanced / New)

  Purpose:     Display a message, enable or disable batch file or
               command-line echoing, or display the echo status.

  Format:      ECHO [ON | OFF | message]

               ECHOERR message

               message:  Text to display.

               See also:  ECHOS, SCREEN, SCRPUT, SETDOS and TEXT.

  Usage:       4DOS, 4OS2, and 4NT have a separate echo capability
               for batch files and for the command line.  The
               command-line ECHO state is independent of the batch
               file ECHO state; changing ECHO in a batch file has no
               effect on the display at the command prompt, and vice
               versa.

               To see the current echo state, use the ECHO command
               with no arguments.  This displays either the batch
               file or command-line echo state, depending on where
               the ECHO command is performed.

               In a batch file, if you turn ECHO on, each line of
               the file is displayed before it is executed.  If you
               turn ECHO off, each line is executed without being
               displayed.  ECHO can also be used in a batch file to
               display a message on the screen.  Regardless of the
               ECHO state, a batch file line that begins with the
               [@] character will not be displayed.  To turn off
               batch file echoing, without displaying the ECHO
               command, use this line:

                    @echo off

               ECHO commands in a batch file will send messages to
               the screen while the batch file executes, even if
               ECHO is set OFF.  For example, this line will display
               a message in a batch file:

                    echo Processing your print files...

               If you want to echo a blank line from within a batch
               file, enter:

                    echo.

               You cannot use the command separator character ([^]
               in 4DOS or [&] in 4OS2 and 4NT) or the redirection
               symbols (| > <) in an ECHO message, unless you
               enclose them in quotes (see page 140) or precede them
               with the escape character (see page 83).

               ECHO defaults to ON in batch files.  The current ECHO
               state is inherited by called batch files.  You can
  -250-

               change the default setting to ECHO OFF with the
               SETDOS /V0 command, the Options 1 page of the OPTION
               dialogs, or the BatchEcho directive in the .INI file
               (see page 154).

               If you turn the command-line ECHO on, each command
               will be displayed before it is executed.  This will
               let you see the command line after expansion of all
               aliases and variables.  The command-line ECHO is most
               useful when you are learning how to use advanced
               features.  This example will turn command-line
               echoing on:

                    c:\> echo on

               ECHO defaults to OFF at the command line.

               ECHOERR acts like ECHO but sends its output to the
               standard error device (usually the screen) instead of
               the standard output device.  If the standard output
               of a batch file is redirected to a file or another
               device with >, ECHOERR will still generate a screen
               message.  See page 57 for more information about the
               standard output and standard error devices and
               redirection.
  -251-

  ECHOS and ECHOSERR                                             (New)

  Purpose:     Display a message without a trailing carriage return
               and line feed.

  Format:      ECHOS message

               ECHOSERR message

               See also:  ECHO, SCREEN, SCRPUT, TEXT, and VSCRPUT.

  Usage:       ECHOS is useful for text output when you don't want
               to add a carriage return / linefeed pair at the end
               of the line.  For example, you can use ECHOS when you
               need to redirect control sequences to your printer;
               this example sends the sequence Esc P to the printer
               on LPT1:

                    c:\> echos [Ctrl-X]eP > lpt1:

               where [Ctrl-X] represents the up-arrow character.

               You cannot use the command separator character ([^]
               in 4DOS and [&] in 4OS2 and 4NT) or the redirection
               symbols [|><] in an ECHOS message, unless you enclose
               them in quotes (see page 140) or precede them with
               the escape character (see page 83).

           ##  ECHOS does not translate or modify the message text.
               For example, carriage return characters are not
               translated to CR/LF pairs.  ECHOS sends only the
               characters you enter (after escape character and
               back-quote processing).  The only character you
               cannot put into an ECHOS message is the NUL character
               (ASCII 0).

               ECHOSERR acts like ECHOS but sends its output to the
               standard error device (usually the screen) instead of
               the standard output device.  If the standard output
               of a batch file is redirected to a file or another
               device with >, ECHOSERR will still generate a screen
               message.  See page 57 for more information about the
               standard output and standard error devices and
               redirection.
  -252-

  ENDLOCAL                                                       (New)

  Purpose:     Restore the saved disk drive, directory, environment,
               alias list, and special characters.

  Format:      ENDLOCAL

               See also:  SETLOCAL.

  ##  Usage:   The SETLOCAL command in a batch file saves the
               current disk drive, default directory, all
               environment variables, the alias list, and the
               command separator, escape character, parameter
               character, decimal separator, and thousands
               separator.  ENDLOCAL restores everything that was
               saved by the previous SETLOCAL command.

               For example, this batch file fragment saves
               everything, removes all aliases so that user aliases
               will not affect batch file commands, changes the disk
               and directory, changes the command separator, runs a
               program, and then restores the original values:

                    setlocal
                    unalias *
                    cdd d:\test
                    setdos /c~
                    program ~ echo Done!
                    endlocal

               SETLOCAL and ENDLOCAL can only be used in batch
               files, not in aliases or from the command line.
  -253-

  ESET                                                           (New)

  Purpose:     Edit environment variables and aliases.

  Format:      ESET [/A /M] variable name...

               variable name:  The name of an environment variable
               or alias to edit.

               /A(lias)            /M(aster environment)

               See also:  ALIAS, UNALIAS, SET, and UNSET.

  Usage:       ESET allows you to edit environment variables and
               aliases using line editing commands (see page 35 for
               information on line editing).

               For example, to edit the executable file search path:

                    c:\> eset path
                    path=c:\;c:\dos;c:\util

               To create and then edit an alias:

                    c:\> alias d = dir /d/j/p
                    c:\> eset d
                    d=dir /d/j/p

               ESET will search for environment variables first and
               then aliases.  If you have an environment variable
               and an alias with the same name, ESET will edit the
               environment variable and ignore the alias unless you
               use the /A option.

               Environment variable and alias names are normally
               limited to 80 characters.  Their values are normally
               limited to 255 characters in 4DOS, or 1,023
               characters in 4OS2 and 4NT.  However, if you use
               special techniques to create a longer environment
               variable, ESET will edit it provided the variable
               contains no more than 511 characters of text in 4DOS,
               or 2,047 characters in 4OS2 and 4NT.

               If you have enabled global aliases (see page 185),
               any changes made to an alias with ESET will
               immediately affect all other copies of the command
               processor which are using the same alias list.

  Option:      /A(lias):  Edit the named alias even if an
               environment variable of the same name exists.  If you
               have an alias and an environment variable with the
               same name, you must use this switch to be able to
               edit the alias.

       4DOS    /M(aster environment):  Edit an environment variable
               in the master environment rather than the local
               environment.  This option is only useful from a
  -254-

               secondary command shell (for example, when an
               application has "shelled to DOS").  /M only works for
               environment variables; it cannot be used to edit the
               primary shell's aliases.
  -255-

  EXCEPT                                                         (New)

  Purpose:     Perform a command on all available files except those
               specified.

  Format:      EXCEPT (file) command

               file:  The file or files to exclude from the command.
               command:  The command to execute, including all
               appropriate arguments and switches.

               See also:  ATTRIB and File Exclusion Ranges (page
               72).

  File Selection:   Supports extended wildcards, ranges, multiple
               file names, and include lists (see pages 64 - 73).
               Ranges must appear immediately after the EXCEPT
               keyword.  Use extended wildcards with caution on LFN
               volumes; see page 74 for details.

  Usage:       EXCEPT provides a means of executing a command on a
               group of files and/or subdirectories, and excluding a
               subgroup from the operation.  The command can be an
               internal command or alias, an external command, or a
               batch file.

               You may use wildcards to specify the files to exclude
               from the command.  The first example erases all the
               files in the current directory except those beginning
               with MEMO, and those whose extension is .WKS.  The
               second example copies all the files and
               subdirectories on drive C to drive D except those in
               C:\MSC and C:\DOS, using the COPY command:

                    c:\> except (memo*.* *.wks) erase *.*
                    c:\> except (c:\msc c:\dos) copy c:\*.* d:\ /s

               When you use EXCEPT on an HPFS, NTFS, or LFN drive,
               you must quote any file names inside the parentheses
               which contain whitespace or special characters.  See
               page 14 for additional details.  For example, to copy
               all files except those in the "Program Files"
               directory to drive E:\:

                    c:\> except ("Program Files") copy /s *.* e:\

           !   EXCEPT prevents operations on the specified file(s)
               by setting the hidden attribute, performing the
               command, and then clearing the hidden attribute.  If
               the command is aborted in an unusual way, you may
               need to use the ATTRIB command to remove the hidden
               attribute from the file(s).

           !   EXCEPT will not work with programs or commands that
               ignore the hidden attribute or which work explicitly
               with hidden files, including DEL /Z, and the /H
  -256-

               (process hidden files) switch available in some 4DOS,
               4OS2, and 4NT file processing commands.

               File exclusion ranges (see page 72) provide a faster
               and more flexible method of excluding files from
               internal commands, and do not manipulate file
               attributes, as EXCEPT does.  However, exclusion
               ranges can only be used with 4DOS, 4OS2, and 4NT
               internal commands; you must use EXCEPT for external
               commands.

           ##  Date, time, and size ranges can be used immediately
               after the word EXCEPT to further qualify which files
               should be excluded from the command.  If the command
               is an internal command that supports ranges, an
               independent range can also be used in the command
               itself.  You can also use a file exclusion range
               within the EXCEPT command; however, this will select
               files to be excluded from EXCEPT, and therefore
               included in execution of the command.

           ##  You can use command grouping (see page 81) to execute
               multiple commands with a single EXCEPT.  For example,
               the following command copies all files in the current
               directory whose extensions begin with .DA, except the
               .DAT files, to the D:\SAVE directory, then changes
               the first two characters of the extension of the
               copied files to .SA.  This example should be entered
               on one line:

                    c:\data> except (*.dat) (copy *.da* d:\save ^
                             ren *.da* *.sa*)

           ##  If you use filename completion (see page 41) to enter
               the filenames inside the parentheses, type a space
               after the open parenthesis before entering a partial
               filename or pressing Tab.  Otherwise, the command-
               line editor will treat the open parenthesis as the
               first character of the filename to be completed.
  -257-

  EXIT                                                      (Enhanced)

  Purpose:     Return from the command processor.

  Format:      EXIT [value]

               value:  The numeric exit code to return.

  Usage:       EXIT terminates the current copy of the command
               processor.  Use it to return to an application when
               you have "shelled out" to work at the prompt, or to
               end a command-line session under OS/2, Windows 3.x,
               Windows 95, or Windows NT.

               To close the session, or to return to the application
               that started the command processor, type:

                    c:\> exit

               If you specify a value, EXIT will return that value
               to the program that started the command processor.
               For example:

                    c:\> exit 255

               The value is a number you can use to inform the
               program of some result, such as the success or
               failure of a batch file.  It can range from 0 - 255
               in 4DOS, or 0 - 4,294,967,295 in 4OS2 and 4NT.  This
               feature is most useful for systems which use batch
               files to automate their operation, such as bulletin
               boards, or custom application programs like databases
               that shell to the command processor to perform
               certain tasks.

       4DOS ## You cannot EXIT from the primary 4DOS shell under
               DOS.  If EXIT does not seem to have any effect, you
               are probably in the primary shell.
  -258-

  FFIND                                                          (New)

  Purpose:     Search for files by name or contents.

  Format:      FFIND [/A[[:][-]rhsda] /B /C /D[list] /E /I /K /L /M
               /O[[:][-]acdeginrsu] /P /R /S /[T|X]"xx" /V] file...

               list:  A list of disk drive letters (without colons).
               file:  The file, directory, or list of files or
               directories to display.

               /A(ttribute select)      /M (no footers)
               /B(are)                  /O(rder)
               /C(ase sensitive)        /P(ause)
               /D(rive)                 /R(everse)
               /E (upper case display)  /S(ubdirectories)
               /I(gnore wildcards)      /T"xx"  (text search string)
               /K (no headers)          /V(erbose)
               /L(ine numbers)          /X["xx"] (hex search string)

  File Selection:   Supports extended wildcards, ranges, multiple
               file names, and include lists (see pages 64 - 73).

  Usage:       FFIND is a flexible search command that looks for
               files based on their names and their contents.
               Depending on the options you choose, FFIND can
               display filenames, matching text, or a combination of
               both in a variety of formats.

               If you want to search for files by name, FFIND works
               much like the DIR command.  For example, to generate
               a list of all the .BTM files in the current
               directory, you could use the command

                    c:\> ffind *.btm

               The output from this command is a list of full
               pathnames, followed by the number of files found.

               If you want to limit the output to a list of .BTM
               files which contain the string color, you could use
               this command instead:

                    c:\> ffind /t"color" *.btm

               The output from this command is a list of files that
               contain the string color along with the first line in
               each file that contains that string.  By default,
               FFIND uses a case-insensitve search, so the command
               above will include files that contain COLOR, Color,
               color, or any other combination of upper-case and
               lower-case letters.

               If you would rather see the last line of each file
               that contains the search string, use the /R option,
               which forces FFIND to search from the end of each
               file to the beginning.  This option will also speed
  -259-

               up searches somewhat if you are looking for text that
               will normally be at the end of a file, such as a
               signature line:

                    c:\> ffind /r /t"Sincerely," *.txt

               You can use extended wildcards in the search string
               to increase the flexibility of FFIND's search.  For
               example, the following command will find .TXT files
               which contain either the string June or July (it will
               also find Juny and Jule).  The /C option makes the
               search case-sensitive:

                    c:\> ffind /c /t"Ju[nl][ey]" *.txt

               If you want to search for text that contains wildcard
               characters (*, ?, [, or ]), you can use the /I option
               to force FFIND to interpret these as normal
               characters instead of wildcards.  The following
               command, for example, finds all .TXT files that
               contain a question mark:

                    c:\> ffind /i /t"?" *.txt

               At times, you may need to search for data that cannot
               be represented by ASCII characters.  You can use
               FFIND's /X option to represent the search string in
               hexadecimal format (this option also changes the
               output to show hexadecimal offsets rather than text
               lines).  With /X, the search must be represented by
               pairs of hexadecimal digits separated by spaces; a
               search of this type is always case-sensitive (in the
               example below, 41 63 65 is the hex code for "Ace"):

                    c:\> ffind /x"41 63 65" *.txt

               You can use FFIND's other options to further specify
               the files for which you are searching and to modify
               the way in which the output is displayed.

               When you use FFIND on an HPFS, NTFS, or LFN drive,
               you must quote any file names which contain
               whitespace or special characters.  See page 14 for
               additional details.

  Options:     /A(ttribute select):  Find only those files that have
               the specified attribute(s) set.  See Attribute
               Switches on page 174 for information on the
               attributes which can follow /A.

               /B(are):  Display file names only and omit the text
               that matches the search.  This option is only useful
               in combination with /T or /X, which normally force
               FFIND to display file names and matching text.

               /C(ase sensitive):  Perform a case-sensitive search.
               This option is only valid with /T, which defaults to
  -260-

               a case-insenitive search.  It is not needed with a /X
               hexadecimal search, which is always case-sensitive.

               /D(rive):  Search all files on one or more drives.
               If you use /D without a list of drives, FFIND will
               search the drives specified in the list of files.  If
               no drive letters are listed, FFIND will search all of
               the current drive.  You can include a list of drives
               or a range of drives to search as part of the /D
               option.  For example, to search drives C:, D:, E:,
               and G:, you can use either of these commands:

                    c:\> ffind /dcdeg ...
                    c:\> ffind /dc-eg ...

           ##  Drive letters listed after /D will be ignored when
               processing file names which also include a drive
               letter.  For example, this command displays all the
               .BTM files on C: and E:, but only the .BAT files on
               D:

                    c:\> ffind /s /dce *.btm d:\*.bat

               /E:  Display filenames in the traditional upper case;
               also see SETDOS /U (page 367) and the UpperCase
               directive in 4DOS.INI (page 159).

               /I(gnore wildcards):  Only meaningful when used in
               conjunction with the /T "text" option.  Suppresses
               the recognition of wildcard characters in the search
               text.  This option is useful if you need to search
               for characters that would normally be interpreted as
               wildcards: *, ?, [, and ].

               /K  (No headers):  Suppress the display of the header
               or filename for each matching text line.

               /L(ine numbers):  Include the line number for each
               text line displayed.

               /M  (No footers):  Suppress the footer (the number of
               files and number of matches) at the end of FFIND's
               display.

               /O(rder):  Set the sort order for the files that
               FFIND displays.  You may use any combination of the
               following sorting options; if multiple options are
               used, the listing will be sorted with the first sort
               option as the primary key, the next as the secondary
               key, and so on:

                    -    Reverse the sort order for the next option

                    a    Sort names and extensions in standard ASCII
                         order, rather than sorting numerically when
                         digits are included in the name or
                         extension.
  -261-

      4DOS          c    Sort by compression ratio (the least
                         compressed file in the list will be
                         displayed first).

                    d    Sort by date and time (oldest first); for
                         drives which support long file names, also
                         see /T.

                    e    Sort by extension.

                    g    Group subdirectories first, then files.

                    i    Sort by the file description (ignored if /C
                         or /O:c is also used).

                    n    Sort by filename (this is the default).

                    r    Reverse the sort order for all options.

                    s    Sort by size.

                    u    Unsorted.

               /P(ause):  Wait for a key to be pressed after each
               screen page before continuing the display.  Your
               options at the prompt are explained in detail on page
               50.

               /R(everse):  Only meaningful when used in conjuction
               with the /T "text" or /X options.  Searches each file
               from the end backwards to the beginning.  This option
               is useful if you want to display the last occurrence
               of the search string in each file instead of the
               first (the default).  It can also speed up searches
               for information that is normally at the end of a
               file, such as a signature.

               /S(ubdirectories):  Display matches from the current
               directory and all of its subdirectories.

               /T"text" (Text search):  Specify the text search
               string.  /T must be followed by a text string in
               double quotes (e.g., /t"color").  FFIND will perform
               a case-insensitive search unless you also use the /C
               option.  For a hexadecimal search and/or hexadecimal
               display of the location where the search string is
               found, see /X.  You can specify a search string with
               either /T or /X, but not both.

               /V(erbose):  Show every matching line.  FFIND's
               default behavior is to show only the first matching
               line then and then go on to the next file.  This
               option is only valid with /T or /X.

               /X["xx"] (Hexadecimal display / search):  Specify
               hexadecimal display and an optional hexadecimal
               search string.
  -262-

               If /X is followed by one or more pairs of hexadecimal
               digits in quotes (e.g., /x"44 63 65"), FFIND will
               search for that exact sequence of bytes without
               regard to the meaning of those bytes as text.  If
               those bytes are found, the offset is displayed (in
               both decimal and hexadecimal).  A search of this type
               will always be case-sensitive.

               If /X is not followed by a hexadecimal search string
               it must be used with /T, and will change the output
               format to display offsets (in both decimal and
               hexadecimal) rather than actual text lines when the
               search string is found.  For example, this command
               uses /T to display the first line in each .BTM file
               containing the word "hello":

                    c:\> ffind /t"hello" *.btm
                    ---- c:\test.btm
                    echo hello

                        1 line in 1 file

               If you use the same command with /X, the offset is
               displayed instead of the text:

                    c:\> ffind /t"hello" /x *.btm
                    ---- c:\test.btm
                    Offset: 26 (1Ah)

                    1 line in 1 file

               You can specify a search string with either /T or /X,
               but not both.
  -263-

  FOR                                                       (Enhanced)

  Purpose:     Repeat a command for several values of a variable.

  Format:      FOR [/A:[[-]rhsda] /D /F ["options"] /H /L /R [path]]
               %var IN
               ([@]set | start, step, end) [DO] command ...

               options:  Parsing options for a "file parsing" FOR.
               path:  The starting directory for a "recursive" FOR.
               %var:  The variable to be used in the command ("FOR
               variable").
               set:  A set of values for the variable.
               start:  The starting value for a "counted" FOR.
               step:  The increment value for a "counted" FOR.
               end:  The limit value for a "counted" FOR.
               command:  A command or group of commands to be
               executed for each value of the variable.

               /A: (Attribute select)   /H(ide dots)
               /D(isable "/")           /L (counted loop)
               /F(ile parsing)          /R(ecursive)

  File Selection:   Supports extended wildcards, ranges, multiple
               file names, and include lists (see pages 64 - 73).
               Ranges must appear immediately after the FOR keyword.
               Use extended wildcards with caution on LFN volumes;
               see page 74 for details.

  Usage:       FOR begins by creating a set.  It then executes a
               command for every member of the set.  The command can
               be an internal command, an alias, an external
               command, or a batch file.  The members of the set can
               be a list of file names, text strings, a group of
               numeric values, or text read from a list of files.

               When the set is made up of text or several separate
               file names (not an include list), the elements must
               be separated by spaces, tabs, commas, or the switch
               character (normally a slash [/]).

               FOR includes a large number of options, some of which
               duplicate functions available in other 4DOS, 4OS2,
               and 4NT commands, and / or do not follow conventions
               you may find in our other commands.  Most of these
               extra options are included for compatibility with
               Windows NT 4.0's CMD.EXE.  However, we make them
               available in all three of our products so that
               aliases and batch files which use them can work under
               all products.

               The first three sections below (Working with Files,
               Working with Text, and Retrieving Text from Files)
               describe the traditional FOR command and the
               enhancements to it which are part of 4DOS, 4OS2, and
               4NT.  The sections on Parsing Text from Files and
               Counted FOR Loops describe features added for
  -264-

               compatibility with Windows NT 4.0.  The section
               entitled Other Notes contains information you may
               need if you use any aspect of the FOR command
               extensively.


               Working with Files

               Normally, the set is a list of files specified with
               wildcards.  For example, if you use this line in a
               batch file:

                    for %x in (*.txt) do list %x

               then LIST will be executed once for each file in the
               current directory with the extension .TXT.  The FOR
               variable %x is set equal to each of the file names in
               turn, then the LIST command is executed for each
               file.  (You could do the same thing more easily with
               a simple LIST *.TXT.  We used FOR here so you could
               get a feel for how it operates, using a simple
               example.  Many of the examples in this section are
               constructed in the same way.)

               The set can include multiple files or an include
               list, like this:

                    for %x in (d:\*.txt;*.doc;*.asc) do type %x

               FOR supports wildcards and extended wildcards (see
               page 64), as well as extended parent directory names
               (e.g., ...\*.txt to process all of the .TXT files
               that are contained in the directory 2 levels above
               the current directory).

               When you use FOR on an HPFS, NTFS, or LFN drive, you
               must quote any file names within the set which
               contain whitespace or special characters.  The same
               restriction applies to names returned in the FOR
               variable, if you pass them to 4DOS, 4OS2, or 4NT
               internal commands, or other commands which require
               quoting filenames with whitespace.  FOR does not
               quote returned names automatically, even if you
               included quotes in the set.  See page 14 for
               additional details on file name quoting.

               If the set includes filenames, the file list can be
               further refined by using date, time, size and file
               exclusion ranges (see pages 67 and 72).  The range or
               ranges must be placed immediately after the word FOR.
               Ranges will be ignored if no wildcards are used
               inside the parentheses.  For example, this set is
               made up of all of the .TXT files that were created or
               updated on October 4, 1997:

                    for /[d10-4-97,+0] %x in (*.txt) do ...
  -265-

               If the command is an internal command that supports
               ranges, an independent range can also be used in the
               command itself.

               You can also refine the list by limiting it with the
               /A: option to select only files that have specific
               attributes.

               By default, FOR works only with files in the current
               directory or a specified directory.  With the /R
               option, FOR will also search for files in
               subdirectories.  For example, to work with all of the
               .TXT files in the current directory and its
               subdirectories:

                    for /r %x in (*.txt) do ...

               If you specify a directory name immediately after /R,
               FOR will start in that directory and then search each
               of its subdirectories.  This example works with all
               of the .BAK files on drive D:

                    for /r d:\ %x in (*.bak) do ...

           ##  When you use wildcards to specify the set, FOR scans
               the directory and finds each file which matches the
               wildcard name(s) you specified.  If, during the
               processing of the FOR command, you create a file that
               could be included in the set, it may or may not
               appear in a future interation of the same FOR
               command.  Whether the new file appears depends on its
               physical location in the directory structure.  For
               example, if you use FOR to execute a command for all
               .TXT files, and the command also creates one or more
               new .TXT files, those new files may or may not be
               processed during the current FOR command, depending
               on where they are placed in the physical structure of
               the directory.  This is an operating system
               constraint over which 4DOS, 4OS2, and 4NT have no
               control.  Therefore, in order to achieve consistent
               results you should construct FOR commands which do
               not create files that could become part of the set
               for the current command.


               Working with Text

               The set can also be made up of text instead of file
               names.  For example, to create three files named
               file1, file2, and file3, each containing a blank
               line:

                    for %suffix in (1 2 3) do echo. > file%suffix

               You could also use the names of environment variables
               as the text.  This example displays the name and
               content of several variables from the environment
  -266-

               (see page 107 for details on the use of square
               brackets when expanding environment variables).
               Enter this on one line:

                    for %var in (path prompt comspec) do echo
                    %var=%[%var]


               Retrieving Text from Files

               FOR can extract text from files in two different
               ways.  The first method extracts each line from each
               file in the set and places it in the variable.  To
               use this method, place an [@] at the beginning of the
               set, in front of the file name or names.

               For example, if you have a file called DRIVES.TXT
               that contains a list of drives on your computer, one
               drive name per line (with a ":" after each drive
               letter), you can print the free space on each drive
               this way:

                    for %d in (@drives.txt) do free %d > prn

               Because the [@] is also a valid filename character,
               FOR first checks to see if the file exists with the
               [@] in its name (i.e., a file named @DRIVES.TXT).  If
               so, the filename is treated as a normal argument.  If
               it doesn't exist, FOR uses the filename (without the
               [@]) as the file from which to retrieve text.

               If you use @CON as the filename, FOR will read from
               standard input (a redirected input file) or a pipe;
               see pages 58 and 61 for more information.  If you use
               @CLIP: as the filename, FOR will read any text
               available from the Windows or OS/2 clipboard (see
               page 59 for details on when you can use the clipboard
               under 4DOS).


           ##  Parsing Text from Files

               The second method of working with text from files is
               to have FOR parse each line of each file for you.  To
               begin a "file-parsing" FOR, you must use the /F
               option and then include one or more file names in the
               set.  When you use this form of FOR, the variable
               must be a single letter, for example, %a.

               This method of parsing, included for compatibility
               with Windows NT 4.0's CMD.EXE, can be cumbersome and
               inflexible.  For a more powerful method, use FOR with
               @filename as the set to retrieve each line from the
               file, as described in the previous section.  Then use
               variable functions like @INSTR, @LEFT, @RIGHT, and
               @WORD to parse the line (see page 119 for information
               on variable functions).
  -267-

               By default, FOR will extract the first word or token
               from each line and return it in the variable.  For
               example, to display the first word on each line in
               the file FLIST.TXT:

                    for /f %a in (flist.txt) do echo %a

               You can control the way FOR /F parses each line by
               specifying one or more parsing options in a quoted
               string immediately after the /F.  The available
               options are:

                 skip=n:  FOR /F will skip "n" lines at the
                 beginning of each file before parsing the remainder
                 of the file.

                 tokens=n, m, ... :  By default, FOR /F returns just
                 the first word or "token" from each parsed line in
                 the variable you named.  You can have it return
                 more than one token in the variable, or return
                 tokens in several variables, with this option.

                 This option is followed by a list of numbers
                 separated by commas.  The first number tells FOR /F
                 which token to return in the first variable, the
                 second number tells it which to return in the
                 second variable, etc.  The variables follow each
                 other alphabetically starting with the variable you
                 name on the FOR command line.  This example returns
                 the first word of each line in each text file in
                 %d, the second in %e, and the third in %f:

                         for /f "tokens=1,2,3" %d in (*.txt) do ...

                 You can also indicate a range of tokens by
                 separating the numbers with a hyphen [-].  This
                 example returns the first word of each line in %p,
                 the second through fifth words in %q, and the
                 eighth word in %r:

                         for /f "tokens=1,2-5,8" %p in (*.txt) do
                         ...

                 To return the rest of the line in a variable, use a
                 range that ends with a number higher than the last
                 token in any line, such as 999.  This final example
                 returns the first word of each line in %a and the
                 remainder of each line (assuming that no line has
                 more than 999 words!) in %b:

                         for /f "tokens=1,2-999" %a in (*.txt) do
                         ...

                 eol=c:  If FOR /F finds the character "c" in the
                 line, it will assume that the character and any
                 text following it are part of a comment and ignore
                 the rest of the line.
  -268-

                 delims=xxx...:  By default, FOR /F sees spaces and
                 tabs as word or token delimiters.  This option
                 replaces those delimiters with all of the
                 characters following the equal sign to the end of
                 the string.  This option must therefore be the last
                 one used in the quoted options string.

               You can also use FOR /F to parse a single string
               instead of each line of a file by using the string,
               in quotes, as the set.  For example, this command
               will assign variable A to the string "this", B to
               "is", etc., then display "this" (enter the command on
               one line):

                    for /f "tokens=1,2,3,4" %a in ("this is a test")
                    do echo %a


           ##  "Counted" FOR Loop

               The "counted FOR" loop is included only for
               compatibility with Windows NT 4.0's CMD.EXE.  In most
               cases, you will find the DO command (page 241) more
               useful for performing counted loops.

               In a counted FOR command, the set is made up of
               numeric values instead of text or file names.  To
               begin a counted FOR command, you must use the /L
               option and then include three values, separated by
               commas, in the set.  These are the start, step, and
               end values.  During the first iteration of the FOR
               loop, the variable is set equal to the start value.
               Before each iteration, the variable is increased by
               the step value.  The loop ends when the variable
               exceeds the end value.  This example will print the
               numbers from 1 to 10:

                    for /l %val in (1,1,10) do echo %val

               This example will print the odd numbers from 1 to 10
               (1, 3, 5, 7, and 9):

                    for /l %val in (1,2,10) do echo %val

               The step value can be negative.  If it is, the loop
               will end when the variable is less than the end
               value.


           ##  Other Notes

               You can use either % or %% in front of the variable
               name.  Either form will work, whether the FOR command
               is typed from the command line or is part of an alias
               or batch file (some traditional command processors
               require a single % if FOR is used at the command
               line, butrequire %% if FOR is used in a batch file).
  -269-

               The variable name can be up to 80 characters long.
               The word DO is optional.

               If you use a single-character FOR variable name, that
               name is given priority over any environment variable
               which starts with the same letter, in order to
               maintain compatibility with the traditional FOR
               command.  For example, the following command tries to
               add a: and b: to the end of the PATH, but will not
               work as intended:

                    c:\> for %p in (a: b:) do path %path;%p

               The "%p" in "%path" will be interpreted as the FOR
               variable %p followed by the text "ath", which is not
               what was intended.  To get around this, use a
               different letter or a longer name for the FOR
               variable, or use square brackets around the variable
               name (see page 107).

               The following example uses FOR with variable
               functions to delete the .BAK files for which a
               corresponding .TXT file exists in the current
               directory (this should be entered on one line):

                    c:\docs> for %file in (*.txt) do del
                             %@name[%file].bak

               The above command would not work properly on an HPFS,
               NTFS, or LFN drive, because the returned FILE
               variable might contain whitespace.  To correct this
               problem, you would need two sets of quotes, one for
               DEL and one for %@NAME:

                    c:\docs> for %file in (*.txt) do del
                             "%@name["%file"].bak"

               You can use command grouping (see page 81) to execute
               multiple commands for each element in the set.  For
               example, the following command copies each .WKQ file
               in the current directory to the D:\WKSAVE directory,
               then changes the extension of each file in the
               current directory to .SAV.  This should be entered on
               one line:

                    c:\text> for %file in (*.wkq) do (copy "%file"
                             d:\wksave\ ^ ren "%file" *.sav)

               (Use an ampersand [&] as the separator character if
               you are using 4OS2 or 4NT.)

               In a batch file you can use GOSUB to execute a
               subroutine for every element in the set.  Within the
               subroutine, the FOR variable can be used just like
               any environment variable.  This is a convenient way
               to execute a complex sequence of commands for every
  -270-

               element in the set without CALLing another batch
               file.

               One unusual use of FOR is to execute a collection of
               batch files or other commands with the same
               parameter.  For example, you might want to have three
               batch files all operate on the same data file.  The
               FOR command could look like this (enter this on one
               line):

                    c:\> for %cmd in (filetest fileform fileprnt)
                         do %cmd datafile

               This line will expand to three separate commands:

                    filetest datafile
                    fileform datafile
                    fileprnt datafile

               The variable that FOR uses (the %CMD in the example
               above) is created in the environment and then erased
               when the FOR command is done.  (For compatibility
               with COMMAND.COM and CMD.EXE, a single-character FOR
               variable is created in a special way that does not
               overwrite an existing environment variable with the
               same name.)  When using a multi-character variable
               name you must be careful not to use the name of one
               of your environment variables as a FOR variable.  For
               example, a command that begins

                    c:\> for %path in ...

               will write over your current path setting, then erase
               the path variable completely when FOR is done.

       4DOS    FOR statements can be nested.  Under 4DOS, the
               permissible nesting level depends on the amount of
               free space in 4DOS's internal stack.  If you receive
               a stack overflow error when using FOR in complex,
               nested command sequences, see the notes under the
               StackSize directive on page 167.

  Options: ##  /A:  (Attribute select):  Process only those files
               that have the specified attribute(s).  /A: will be
               used only when processing wildcard file names in the
               set.  It will be ignored for filenames without
               wildcards or other items in the set.  See Attribute
               Switches on page 174 for information on the
               attributes which can follow /A:.

               For example, to process only those files with the
               archive attribute set:

                    for /a:a %f in (*.*) echo %f needs a backup!

       4DOS ## /D(isable "/"):  Disables the special processing of
               the forward slash [/] character in the FOR set.  For
  -271-

               compatibility with certain versions of COMMAND.COM
               (those prior to Windows 95), 4DOS normally treats a
               forward slash inside the set as an "escape"
               character, discard the slash, and return the
               character after the slash, followed by the remainder
               of the string.  This behavior can be used in batch
               files to separate a string into individual characters
               (although 4DOS provides a much easier method with the
               @INSTR and @LEFT variable functions).

               The /D option must follow the FOR keyword and come
               before the variable name.  These examples show the
               effects of /D:

                    c:\> for %s in (/abcdef) do echo %s
                    a
                    bcdef

                    c:\> for /d %s in (/abcdef) do echo %s
                    /abcdef

               /F(ile parsing):  Return one or more words or tokens
               from each line of each file in the set.  The /F
               option can be followed by one or more options in a
               quoted string which control how the parsing is
               performed.  See the details under Parsing Text From
               Files, above.

               /H(ide dots):  Suppress the assignment of the "." and
               ".." directories to the FOR variable.

               /L  ("Counted loop"):  Interpret the three values in
               the set as the start, step, and end values of a
               counted loop.  See the details under "Counted FOR"
               Loop, above.

               /R(ecursive):  Look in the current directory and all
               of its subdirectories for files in the set.  If the
               /R is followed by a directory name, look for files in
               that directory and all of its subdirectories.
  -272-

  FREE                                                           (New)

  Purpose:     Display the total disk space, total bytes used, and
               total bytes free on the specified (or default)
               drive(s).

  Format:      FREE [drive: ...]

               drive:  One or more drives to include in the report.

               See also:  MEMORY.

  Usage:       FREE provides the same disk information as the
               external command CHKDSK, but without the wait, since
               it does not check the integrity of the file and
               directory structure of the disk.

               A colon [:] is required after each drive letter.
               This example displays the status of drives A and C:

                    c:\> free a: c:
                     Volume in drive A: is unlabeled
                      1,213,952 bytes total disk space
                      1,115,136 bytes used
                         98,816 bytes free
                     Volume in drive C: is DEVELOPMENT
                     242,496,000 bytes total disk space
                     236,851,712 bytes used
                       5,644,288 bytes free

               If you are using DOS 4.0 or later, OS/2, or Windows
               NT, the volume serial number will appear after the
               drive label or name.

       4DOS    DOS networks with large server disk drives (over 2
               GB) may report disk space values that are too small
               when FREE is used.  If this occurs, it is because the
               network software does not report the proper values to
               4DOS.
  -273-

  FTYPE      [4NT]                                        (Compatible)

  Purpose:     Modify or display the command used to open a file of
               a type specified in the Windows NT registry.

  Format:      FTYPE [/P] [filetype[=[command]]]

               filetype:  A file type stored in the Windows NT
               registry.
               command:  The command to be executed when a file of
               the specified type is opened.

               /P(ause)

               See also:  ASSOC, and Executable Extensions on page
               75.

  Usage:       FTYPE allows you to display or update the command
               used to open a file of a specified type listed in the
               Windows NT registry.

               FTYPE modifies the behavior of "indirect" Windows
               file associations stored under the registry handle
               HKEY_CLASSES_ROOT, and discussed in more detail on
               pages 20 and 77.  If you are not familiar with file
               associations be sure to read about them before using
               FTYPE.

               The entry modified by FTYPE is the Shell\Open\Command
               entry for the specified file type, which defines the
               application to execute when a file of that type is
               opened.  The open action is generally invoked by
               selecting Open on the popup menu for a file from the
               Windows NT Explorer.  Note that opening a file and
               double-clicking its icon (or selecting the icon and
               pressing Enter) may not be the same thing -- double-
               clicking or pressing Enter invokes the default action
               for the file type, which may or may not be "Open".

               If you invoke FTYPE with no parameters, it will
               display the current file types and associated shell
               open commands.  Use the /P switch to pause the
               display at the end of each page.  If you include a
               filetype, with no equal sign or command, FTYPE will
               display the current command for that file type.

               If you include the equal sign and command, FTYPE will
               create or update the shell open command for the
               specified file type.  The command generally includes
               an application name, including full path, plus
               parameters.  The specific syntax required depends on
               the internal operation of both Windows and the
               application involved, and is beyond the scope of this
               manual.  You can learn about typical syntax by
               reviewing appropriate Windows and application
               documentation, and / or by checking through the
               current contents of your registry.
  -274-

               To remove the shell open command for a file type, use
               a command like FTYPE filetype=, with no command
               parameter.  This will not delete the shell open
               command entry from the registry; it simply sets the
               command to an empty string.

           !   FTYPE should be used with caution, and only after
               backing up the registry.  Improper changes to file
               associations can prevent applications and / or the
               operating system from working properly.

  Options:     /P(ause):  Wait for a key to be pressed after each
               screen page before continuing the display.  Your
               options at the prompt are explained in detail on page
               50.
  -275-

  GLOBAL                                                         (New)

  Purpose:     Execute a command in the current directory and its
               subdirectories.

  Format:      GLOBAL [/H /I /P /Q] command

               command:  The command to execute, including arguments
               and switches.

               /H(idden directories)    /P(rompt)
               /I(gnore exit codes)     /Q(uiet)

  Usage:       GLOBAL performs the command first in the current
               directory and then in every subdirectory under the
               current directory.  The command can be an internal
               command, an alias, an external command, or a batch
               file.

               This example copies the files in every directory on
               drive A to the directory C:\TEMP:

                    a:\> global copy *.* c:\temp

               If you use the /P option, GLOBAL will prompt for each
               subdirectory before performing the command.  You can
               use this option if you want to perform the command in
               most, but not all subdirectories of the current
               directory.

           ##  You can use command grouping (see page 81) to execute
               multiple commands in each subdirectory.  For example,
               the following command copies each .TXT file in the
               current directory and all of its subdirectories to
               drive A.  It then changes the extension of each of
               the copied files to .SAV:

                    c:\> global (copy *.txt a: ^ ren *.txt *.sav)

      4DOS !   If you receive a stack overflow error when using
               GLOBAL in complex, nested command sequences, see the
               notes under the StackSize directive on page 167.

  Options: ##  /H(idden directories):  Forces GLOBAL to look for
               hidden directories.  If you don't use this switch,
               hidden directories are ignored.

               /I(gnore exit codes):  If this option is not
               specified, GLOBAL will terminate if the command
               returns a non-zero exit code.  Use /I if you want the
               command to continue in additional subdirectories even
               if it returns an error in one subdirectory.  Even if
               you use /I, GLOBAL will normally halt execution if
               the command processor receives a Ctrl-C or Ctrl-
               Break.
  -276-

               /P(rompt):  Forces GLOBAL to prompt with each
               directory name before it performs the command.  Your
               options at the prompt are explained in detail on page
               50.

               /Q(uiet):  Do not display the directory names as each
               directory is processed.
  -277-

  GOSUB                                                          (New)

  Purpose:     Execute a subroutine in the current batch file.

  Format:      GOSUB label

               label:  The batch file label at the beginning of the
               subroutine.

               See also:  CALL, GOTO and RETURN.

  Usage:       GOSUB can only be used in batch files.

               4DOS, 4OS2, and 4NT allow subroutines in batch files.
               A subroutine must start with a label (a colon [:]
               followed by a one-word label name) which appears on a
               line by itself.  Case differences are ignored when
               matching labels.  Labels may be one or more words
               long.  The subroutine must end with a RETURN
               statement.

               The subroutine is invoked with a GOSUB command from
               another part of the batch file.  After the RETURN,
               processing will continue with the command following
               the GOSUB command.  For example, the following batch
               file fragment calls a subroutine which displays the
               directory and returns:

                    echo Calling a subroutine
                    gosub subr1
                    echo Returned from the subroutine
                    quit

                    :subr1
                    dir /a/w
                    return

               4DOS searches the entire batch file for the label,
               starting at the beginning of the file.  For
               compatibility with CMD.EXE, 4OS2 and 4NT begin their
               search on the next line of the batch file (after the
               GOSUB command).  If the label is not found between
               the current position and the end of the file, GOSUB
               will restart the search at the beginning of the file.
               If the label does not exist, the batch file is
               terminated with the error message "Label not found."

               GOSUB saves the IFF and DO states, so IFF and DO
               statements inside a subroutine won't interfere with
               statements in the part of the batch file from which
               the subroutine was called.

           ##  Subroutines can be nested.  Under 4DOS, the
               permissible nesting level depends on the amount of
               free space in 4DOS's internal stack.  If you receive
               a stack overflow error when using GOSUB in complex,
  -278-

               nested command sequences, see the notes under the
               StackSize directive on page 167.
  -279-

  GOTO                                                    (Compatible)

  Purpose:     Branch to a specified line inside the current batch
               file.

  Format:      GOTO [/I] label

               label:  The batch file label to branch to.

               /I(FF and DO continue)

               See also:  GOSUB.

  Usage:       GOTO can only be used in batch files.

               After a GOTO command in a batch file, the next line
               to be executed will be the one immediately after the
               label.  The label must begin with a colon [:] and
               appear on a line by itself.  The colon is required on
               the line where the label is defined, but is not
               required in the GOTO command itself.  Case
               differences are ignored when matching labels.  Labels
               may be one or more words long.

               This batch file fragment checks for the existence of
               the file CONFIG.SYS.  If the file exists, the batch
               file jumps to C_EXISTS and copies all the files from
               the current directory to the root directory on A:.
               Otherwise, it prints an error message and exits.

                    if exist config.sys goto C_EXISTS
                    echo CONFIG.SYS doesn't exist - exiting.
                    quit
                    :C_EXISTS
                    copy *.* a:\

               4DOS searches the entire batch file for the label,
               starting at the beginning of the file.  For
               compatibility with CMD.EXE, 4OS2 and 4NT begin their
               search on the next line of the batch file (after the
               GOTO command).  If the label is not found between the
               current position and the end of the file, GOTO will
               restart the search at the beginning of the file.  If
               the label does not exist, the batch file is
               terminated with the error message "Label not found."

           !## To avoid errors in the processing of nested
               statements and loops, GOTO cancels all active IFF
               statements and DO / ENDDO loops unless you use /I.
               This means that a normal GOTO (without /I) may not
               branch to any label that is between an IFF and the
               corresponding ENDIFF or between a DO and the
               corresponding ENDDO.

           ##  For compatibility with Windows NT's CMD.EXE, the
               command
  -280-

                    GOTO :EOF

               will end processing of the current batch file if the
               label :EOF does not exist.  However, this is less
               efficient than using the QUIT or CANCEL command to
               end a batch file.

  Options: ##  /I(FF and DO continue):  Prevents GOTO from canceling
               IFF statements and DO loops.  Use this option only if
               you are absolutely certain that your GOTO command is
               branching entirely within any current IFF statement
               and any active DO / ENDDO block.  Using /I under any
               other conditions will cause an error later in your
               batch file.

               You cannot branch into another IFF statement, another
               DO loop, or a different IFF or DO nesting level,
               whether you use the /I option or not.  If you do, you
               will eventually receive an "unknown command" error
               (or execution of the UNKNOWN_CMD alias) on a
               subsequent ENDDO, ELSE, ELSEIFF, or ENDIFF statement.
  -281-

  HELP                                    (Enhanced, External command)

  Purpose:     Display help for internal commands.  Help for
               external commands is also available in some cases;
               see below for details.

  Format:      HELP [topic]

               topic:  A help topic, internal command, or external
               command.

  Usage:       Online help is available for 4DOS, 4OS2, and 4NT.
               The 4OS2 and 4NT help systems use the operating
               system's help facility.  4DOS uses its own help
               program.

               See page 49 for more details on getting help at the
               command line.  See the Introduction and Installation
               Guide for a more thorough explanation of the online
               help available.

               If you type the command HELP by itself (or press F1
               when the command line is empty), the table of
               contents is displayed.  If you type HELP plus a topic
               name, that topic is displayed.  For example:

                    help copy

               displays information about the COPY command and its
               options.

       4DOS    Under 4DOS, your system's DOS help program can be
               started from within the help system to get help on
               DOS external commands. For details see your
               Introduction and Installation Guide.

       4OS2    Under 4OS2, you can configure the HELP command to
               display OS/2's command-line help along with the
               4OS2's (the default), display only the 4OS2 help, or
               display some other combination of help "books".  For
               details see the HelpBook directive (page 149) and
               your Introduction and Installation Guide.
  -282-

  HISTORY                                                        (New)

  Purpose:     Display, add to, clear, or read the history list.

  Format:      HISTORY [/A command /F /P /R filename]

               command:  A command to be added to the history list.
               filename:  The name of a file containing entries to
               be added to the history list.

               /A(dd)                   /P(ause)
               /F(ree)                  /R(ead)

               See also:  DIRHISTORY and LOG.

  Usage:       4DOS, 4OS2, and 4NT keep a list of the commands you
               have entered on the command line.  See page 36 for
               information on command recall, which allows you to
               use the history list to repeat or edit commands you
               have previously executed.

               The HISTORY command lets you view and manipulate the
               command history list directly.  If no parameters are
               entered, HISTORY will display the current command
               history list:

                    c:\> history

               With the options explained below, you can clear the
               list, add new commands to the list without executing
               them, save the list in a file, or read a new list
               from a file.

               The number of commands saved in the history list
               depends on the length of each command line.  The
               history list size can be specified at startup from
               256 to 8192 characters (see page 149).  The default
               size is 1024 characters.

               Your history list can be stored either locally (a
               separate history list for each copy of the command
               processor) or globally (all copies of the command
               processor share the same list).  For full details see
               the discussion of local and global history lists
               beginning on page 40.

           ##  You can use the HISTORY command as an aid in writing
               batch files by redirecting the HISTORY output to a
               file and then editing the file appropriately.
               However, it may be easier to use the LOG /H command
               for this purpose.

           ##  You can disable the history list or specify a minimum
               command-line length to save on the Command Line 1
               page of the OPTION dialogs, or with the HistMin
               directive in the .INI file.
  -283-

           ##  You can save the history list by redirecting the
               output of HISTORY to a file.  This example saves the
               command history to a file called HISTFILE and reads
               it back again immediately.  If you leave out the
               HISTORY /F command on the second line, the contents
               of the file will be appended to the current history
               list instead of replacing it:

                    c:\> history > histfile
                    c:\> history /f
                    c:\> history /r histfile

               If you need to save your history at the end of each
               day's work, you might use commands like this in your
               AUTOEXEC.BAT or other startup file:

                    if exist c:\histfile history /r c:\histfile
                    alias shut*down `history > c:\histfile`

               This restores the previous history list if it exists,
               then defines an alias which will allow you to save
               the history before shutting off the system.

  Options: ##  /A(dd):  Add a command to the history list.  This
               performs the same function as the Ctrl-K key at the
               command line (see page 36).

               /F(ree):  Erase all entries in the command history
               list.

               /P(rompt):  Wait for a key after displaying each page
               of the list.  Your options at the prompt are
               explained in detail on page 50.

           ##  /R(ead):  Read the command history from the specified
               file and append it to the history list currently held
               in memory.  Each line in the file must fit within the
               command-line length limit for your command processor
               (see page 50).

           ##  If you are creating a HISTORY /R file by hand, and
               need to create an entry that spans multiple lines in
               the file, you can do so by terminating each line,
               except the last, with an escape character (see page
               83).  However, you cannot use this method to exceed
               the command-line length limit.
  -284-

  IF                                                        (Enhanced)

  Purpose:     Execute a command if a condition or set of conditions
               is true.

  Format:      IF [/I] [NOT] condition [.AND. | .OR. | .XOR. [NOT]
                    condition ...] command

               condition:  A test or set of tests to determine if
               the command should be executed.
               command:  The command to execute if the condition is
               true.

               /I(gnore case)

               See also:  IFF; @IF on page 130.

  Usage:       IF is normally used only in aliases and batch files.
               It is always followed by one or more conditions and
               then a command.  First, the conditions are evaluated.
               If they are true, the command is executed.
               Otherwise, the command is ignored.  If you add a NOT
               before a condition, the command is executed only when
               the condition is false.

               You can link conditions with .AND., .OR., or .XOR.,
               and you can group conditions with parentheses (see
               Combining Tests below).  You can also nest IF
               statements.

               The conditions can test strings, numbers, the
               existence of a file or subdirectory, the exit code
               returned by the preceding external command, and the
               existence of aliases and internal commands.

               The command can be an alias, an internal command, an
               external command, or a batch file.  The entire IF
               statement, including all conditions and the command,
               must fit on one line.

               Some examples of IF conditions and commands are
               included below; additional examples may be found in
               the EXAMPLES.BTM file which came with your command
               processor.

           ##  You can use command grouping (see page 81) to execute
               multiple commands if the condition is true.  For
               example, the following command tests if any .TXT
               files exist.  If they do, they are copied to drive A:
               and their extensions are changed to .TXO:

                    if exist *.txt (copy *.txt a: ^ ren *.txt *.txo)

               (Change the command separator to an ampersand [&] to
               use a command like this under 4OS2 or 4NT.  Also,
               note that the IFF command provides a more structured
  -285-

               method of executing multiple commands if a condition
               or set of conditions is true.)

      4OS2,##  When an IF test fails, the remainder of the command
      4NT      is discarded, and the command processor normally
               continues with the next command on the line, or the
               next line.  This behavior is not compatible with
               CMD.EXE, which discards all remaining commands on the
               line when an IF test fails, including those after a
               command separator or pipe character.  To change the
               behavior so that IF affects all commands on the line,
               as in CMD.EXE, set DuplicateBugs to Yes in the .INI
               file (see page 149).

               For example, if DuplicateBugs is set to Yes (the
               default), the following command will display nothing,
               because the second ECHO command is discarded along
               with the first when the condition fails.  If
               DuplicateBugs is set to No, it will display "hello":

                    [c:\] if 1 == 2 echo Wrong! & echo hello


               Conditions

               The conditional tests listed in the following
               sections are available in both the IF and IFF
               commands.  They fit into two categories:  string and
               numeric tests, and status tests.  The tests can use
               environment variables, internal variables and
               variable functions, file names, literal text, and
               numeric values as their arguments.


               String and Numeric Tests

               Six test conditions can be used to test character
               strings.  The same conditions are available for both
               numeric and normal text strings (see below for
               details).  In each case you enter the test as:

                    string1 operator string2

               The operator defines the type of test (equal, greater
               than or equal, and so on).  You should always use
               spaces on both sides of the operator.  The operators
               are:

                    Operator    Tests
                    --------    -----

                    EQ or ==    string1 equal to string2

                    NE or !=    string1 not equal to string2

                    LT          string1 less than string2
  -286-

                    LE          string1 less than or equal to
                                string2

                    GE          string1 greater than or equal to
                                string2

                    GT          string1 greater than string2

               When IF compares two character strings, it will use
               either a numeric comparison or a string comparison.
               A numeric comparison treats the strings as numeric
               values and tests them arithmetically.  A string
               comparison treats the strings as text.

               The difference between numeric and string comparisons
               is best explained by looking at the way two values
               are tested.  For example, consider comparing the
               values 2 and 19.  Numerically, 2 is smaller, but as a
               string it is "larger" because its first digit is
               larger than the first digit of 19.  So the first of
               these conditions will be true, and the second will be
               false:

                    if 2 lt 19 ...
                    if "2" lt "19" ...

               IF determines which kind of test to do by examining
               the first character of each string.  If both strings
               begin with a numeric character (a digit, sign, or
               decimal separator), a numeric comparison is used.
               (If a string begins with a decimal separator it is
               not considered numeric unless the next character is a
               digit, and there are no more decimal separators
               within the string.  For example, ".07" is numeric,
               but ".a" and ".07.01" are not.)  If either value is
               non-numeric, a string comparison is used.  To force a
               string comparison when both values are or may be
               numeric, use double quotes around the values you are
               testing, as shown above.  Because the double quote is
               not a numeric character, IF performs a string
               comparison.

               Case differences are ignored in string comparisons.
               If two strings begin with the same text but one is
               shorter, the shorter string is considered to be "less
               than" the longer one.  For example, "a" is less than
               "abc", and "hello_there" is greater than "hello".

               When you compare text strings, you should always
               enclose the arguments in double quotes in order to
               avoid syntax errors which may occur if one of the
               argument values is empty.

               Numeric comparisons work with both integer and
               decimal values.  The values to be compared must
               contain only numeric digits, decimal points, and an
               optional sign (+ or -).  The number may contain up to
  -287-

               16 digits to the left of the decimal point, and 8
               digits to the right.

       4NT     In order to maintain compatibility with CMD.EXE in
               Windows NT 4.0 and later, 4NT recognizes the
               following additional names for conditions:

                    EQL  is the same as EQ and ==

                    NEQ  is the same as NE and !=

                    LSS  is the same as LT

                    LEQ  is the same as LE

                    GTR  is the same as GT

                    GEQ  is the same as GE

               Internal variables (page 110) and variable functions
               (page 119) are very powerful when combined with
               string and numeric comparisons.  They allow you to
               test the state of your system, the characteristics of
               a file, date and time information, or the result of a
               calculation.  You may want to review the variables
               and variable functions when determining the best way
               to set up an IF test.

               This batch file fragment runs a program called
               MONOPROG if a monochrome monitor is attached to the
               system (this example will work in 4DOS or 4OS2; 4NT
               does not include the _MONITOR variable):

                    if "%_monitor" == "mono" monoprog

               This batch file fragment tests for a string value:

                    input "Enter your selection : " %%cmd
                    if "%cmd" == "WP" goto wordproc
                    if "%cmd" NE "GRAPHICS" goto badentry

               This example calls GO.BTM if the first two characters
               in the file MYFILE are "GO" (enter this example on
               one line):

                    if "%@left[2,%@line[myfile,0]]" == "GO"
                    call go.btm

               The next two examples test whether there is more than
               500 KBytes of free memory or more than 2 MBytes of
               free EMS memory (the EMS example only applies to
               4DOS):

                    c:\> if %@dosmem[K] gt 500 echo Over 500K free
                    c:\> if %@ems[M] gt 2 echo Over 2 MB EMS free
  -288-

               Status Tests

               These conditions test the system or command processor
               status.  You can use internal variables and variable
               functions to test many other parts of the system
               status.

                 DEFINED variable

                    If the variable exists in the environment, the
                    condition is true.  This is equivalent to
                    testing whether the variable is not empty, for
                    example the following two commands are
                    equivalent:

                         if defined abc echo Hello
                         if "%abc" != "" echo Hello

                 ERRORLEVEL [operator] n

                    This test retrieves the exit code of the
                    preceding external program.  By convention,
                    programs return an exit code of 0 when they are
                    successful and a number between 1 and 255 to
                    indicate an error (depending on the program you
                    are running, the maximum return value may be
                    larger in 4OS2 and 4NT).  The condition can be
                    any of the operators listed above (EQ, !=, GT,
                    etc.).  If no operator is specified, the default
                    is GE.  The comparison is done numerically.

                    Not all programs return an explicit exit code.
                    For programs which do not, the behavior of
                    ERRORLEVEL is undefined.

                 EXIST filename

                    If the file exists, the condition is true.  You
                    can use wildcards in the filename, in which case
                    the condition is true if any file matching the
                    wildcard name exists.

                    Do not use IF EXIST to test for existence of a
                    directory (use IF ISDIR instead).  Due to
                    variations in operating system internals, IF
                    EXIST will not return consistent results when
                    used to test for the existence of a directory.

                 ISALIAS aliasname

                    If the name is defined as an alias, the
                    condition is true.

                 ISDIR | DIREXIST path

                    If the subdirectory exists, the condition is
                    true.  For compatibility with Novell DOS /
  -289-

                    OpenDOS, DIREXIST may be used as a synonym for
                    ISDIR.

                 ISINTERNAL command

                    If the specified command is an active internal
                    command, the condition is true.  Commands can be
                    activated and deactivated with the SETDOS /I
                    command.

                 ISLABEL label

                    If the specified label exists in the current
                    batch file, the condition is true.   Labels may
                    be one or more words long.

       4NT       ISWINDOW "title"

                    If a window which matches the title exists, the
                    condition is true.  Double quotes must be used
                    around the title, which may contain wildcards
                    and extended wildcards.

               The first batch file fragment below tests for the
               existence of A:\JAN.DOC before copying it to drive C:

                    if exist a:\jan.doc copy a:\jan.doc c:\

               This example tests the exit code of the previous
               program and stops all batch file processing if an
               error occurred:

                    if errorlevel == 0 goto success
                    echo "External Error -- Batch File Ends!"
                    cancel


           ##  Combining Tests

               You can negate the result of any test with NOT, and
               combine tests of any type with .AND., .OR., and .XOR.

               When two tests are combined with .AND., the result is
               true if both individual tests are true.  When two
               tests are combined with .OR., the result is true if
               either (or both) individual tests are true.  When two
               tests are combined with .XOR., the result is true
               only if one of the tests is true and the other is
               false.

               This example runs a program called HIGHRES if either
               an EGA or VGA video adapter is in use (this will work
               in 4DOS or 4OS2; 4NT does not include the _VIDEO
               variable).  Enter this on one line:

                    if "%_video" == "EGA" .or. "%_video" == "VGA"
                    highres
  -290-

               Test conditions are always scanned from left to right
               -- there is no implied order of precedence, as there
               is in some programming languages.  You can, however,
               force a specific order of testing by grouping
               conditions with parentheses, for example (enter this
               on one line):

                    if (%a == 1 .or. (%b == 2 .and. %c == 3)) echo
                    something

               Parentheses can only be used when the portion of the
               condition inside the parentheses contains at least
               one ".and.", ".or.", or ".xor.".  Parentheses on a
               simple condition which does not combine two or more
               tests will be taken as part of the string to be
               tested, and will probably make the test fail.  For
               example, the first of these IF tests would fail; the
               second would succeed:

                    if (a == a) ...
                    if (a == a .and. b == b) ...

               Parentheses can be nested.  Under 4DOS, the
               permissible nesting level depends on the amount of
               free space in 4DOS's internal stack; if you receive a
               stack overflow error when using nested parentheses,
               see the notes under the StackSize directive on page
               167.

  Options:     /I(gnore case):  This option, which is only available
               in 4NT, is included only for compatibility with
               CMD.EXE.  It has no effect, since all string
               comparisons under 4DOS, 4OS2, and 4NT are case-
               insensitive.
  -291-

  IFF                                                            (New)

  Purpose:     Perform IF / THEN / ELSE conditional execution of
               commands.

  Format:      IFF [NOT] condition [.AND. | .OR. | .XOR. [NOT]
                 condition ...] THEN ^ commands
               [ELSEIFF condition  THEN ^ commands] ...
               [ELSE ^ commands]
               ENDIFF

               condition:  A test to determine if the command(s)
               should be executed.
               commands:  One or more commands to execute if the
               condition(s) is true.  If you use multiple commands,
               they must be separated by command separators or be
               placed on separate lines of a batch file.

               See also:  IF, and @IF on page 130.

  Usage:       IFF is similar to the IF command, except that it can
               perform one set of commands when a condition or set
               of conditions is true and a different set of commands
               when the conditions are false.

               IFF can also execute multiple commands when the
               conditions are true or false; IF normally executes
               only one command.  IFF imposes no limit on the number
               of commands and is generally a "cleaner" and more
               structured command than IF.

               IFF is always followed by one or more conditions.  If
               they are true, the commands that follow the word THEN
               are executed.  Additional conditions can be tested
               with ELSEIFF.  If none of these conditions are true,
               the commands that follow the word ELSE are executed.
               After the selected commands (if any) are executed,
               processing continues after the word ENDIFF.

               If you add a NOT before the condition, the THEN
               commands are executed only when the condition is
               false and the ELSE commands are executed only when
               the condition is true.

               The commands may be separated by command separators,
               or may be on separate lines of a batch file.  You
               must include a command separator or a line break
               after a THEN, before an ELSEIFF, and before and after
               an ELSE.  The syntax above and examples below use the
               default 4DOS command separator, a caret [^].  Replace
               the caret with an ampersand [&] if you are using 4OS2
               or 4NT.

               You can link conditions with .AND., .OR., or .XOR.,
               and you can group conditions with parentheses.  You
               can nest IFF statements up to 15 levels deep.  The
               conditions can test strings or numbers, the existence
  -292-

               of a file or subdirectory, the errorlevel returned
               from the preceding external command, and the
               existence of alias names and internal commands.

               See the IF command for a list of the possible
               conditions, and details on using .AND., .OR., .XOR.,
               and parentheses.

               The commands can include any internal command, alias,
               external command, or batch file.

               The following batch file fragment for 4DOS or 4OS2
               tests the monitor type (monochrome or color), and
               sets the appropriate colors and prompt (enter the
               "prompt" lines on one line of the batch file):

                    iff "%_monitor" == "color" then
                      color bright white on blue ^ cls
                      prompt=$e[s$e[1;1f$e[41;1;37m$e[K  Path:
                         $p$e[u$e[44;37m$n$g
                    else
                      prompt=$e[s$e[1;1f$e[0;7m$e[K  Path:
                         $p$e[u$e[0m$n$g
                    endiff

               (The above example uses ANSI color sequences in the
               prompt, which work in 4DOS if an ANSI driver is
               loaded, and in 4OS2.  They will not work in 4NT; see
               PROMPT for additional details.)

               The alias in this second example checks to see if the
               argument is a subdirectory.  If so, the alias deletes
               the subdirectory's files and removes it (enter this
               on one line):

                    c:\> alias prune `iff isdir %1 then ^
                         del /sxz %1 ^ else ^
                         echo Not a directory!^endiff`

           !## Be sure to read the cautionary notes about GOTO and
               IFF under GOTO (page 279) before using GOTO inside an
               IFF statement.

           ##  If you pipe data to an IFF, the data will be passed
               to the command(s) following the IFF, not to IFF
               itself.
  -293-

  INKEY                                                          (New)

  Purpose:     Get a single keystroke from the user and store it in
               an environment variable.

  Format:      INKEY [/C /D /K"keys" /P /Wn /X] [prompt] %%varname

               prompt:  Optional text that is displayed as a prompt.
               varname:  The variable that will hold the user's
               keystroke.

               /C(lear buffer)          /P(assword)
               /D(igits only)           /W(ait)
               /K (valid keystrokes)    /X (no carriage return)

               See also:  INPUT and KEYSTACK.

  Usage:       INKEY optionally displays a prompt.  Then it waits
               for a specified time or indefinitely for a keystroke,
               and places the keystroke into an environment
               variable.  It is normally used in batch files and
               aliases to get a menu choice or other single-key
               input.  Along with the INPUT command, INKEY allows
               great flexibility in reading input from within a
               batch file or alias.

               If prompt text is included in an INKEY command, it is
               displayed while INKEY waits for input.

               The following batch file fragment prompts for a
               character and stores it in the variable NUM:

                    inkey Enter a number from 1 to 9:  %%num

               INKEY reads standard input for the keystroke, so it
               will accept keystrokes from a redirected file or from
               the KEYSTACK.  You can supply a list of valid
               keystrokes with the /K option.

               Standard keystrokes with ASCII values between 1 and
               255 are stored directly in the environment variable.
               Extended keystrokes (for example, function keys and
               cursor keys) are stored as a string in decimal
               format, with a leading @ (for example, the F1 key is
               @59).  The Enter key is stored as an extended
               keystroke, with the code @28.  See the online help
               for a list of the ASCII and extended key codes.

               To test for a non-printing ASCII keystroke returned
               by INKEY use the @ASCII function (see page 122) to
               get the numeric value of the key.  For example, to
               test for Esc, which has an ASCII value of 27:

                    inkey Enter a key:  %%key
                    if "%@ascii[%key]" == "27" echo Esc pressed
  -294-

               If you press Ctrl-C or Ctrl-Break while INKEY is
               waiting for a key, execution of an alias will be
               terminated, and execution of a batch file will be
               suspended while you are asked whether to cancel the
               batch job (see page 93).  A batch file can handle
               Ctrl-C and Ctrl-Break itself with the ON BREAK
               command (see page 327).

       4NT     INKEY works within the command line window.  If you
               prefer to use a dialog for user input, see the MSGBOX
               command.

  Options:     /C(lear buffer):  Clears the keyboard buffer before
               INKEY accepts keystrokes.  If you use this option,
               INKEY will ignore any keystrokes which you type,
               either accidentally or intentionally, before it is
               ready to accept input.

               /D(igits only):  Prevents INKEY from accepting any
               keystroke except a digit from 0 to 9.

               /K"keys":  Specify the permissible keystrokes.  The
               list of valid keystrokes should be enclosed in double
               quotes.  For alphabetic keys the validity test is not
               case-sensitive.  You can specify extended keys by
               enclosing their names in square brackets (within the
               quotes), for example:

                    inkey /k"ab[Alt-F10]" Enter A, B, or Alt-F10
                    %%var

               See page 30 for a complete listing of the key names
               you can use within the square brackets, and a
               description of the key name format.

               If an invalid keystroke is entered, the command
               processor will echo the keystroke if possible, beep,
               move the cursor back one character, and wait for
               another keystroke.

               /P(assword):  Prevents INKEY from echoing the
               character.

               /W(ait):  Timeout period, in seconds, to wait for a
               response.  If no keystroke is entered by the end of
               the timeout period, INKEY returns with the variable
               unchanged.  This allows you to continue the batch
               file if the user does not respond in a given period
               of time.  You can specify /W0 to return immediately
               if there are no keys waiting in the keyboard buffer.

               For example, the following batch file fragment waits
               up to 10 seconds for a character, then tests to see
               if a "Y" was entered:

                    set net=N
                    inkey /K"YN" /w10 Load the network (Y/N)?  %%net
  -295-

                    iff "%net" == "Y" then
                      rem Commands to load the network go here
                    endiff

               /X  (no carriage return):  Prevents INKEY from
               displaying a carriage return and line feed after the
               user's entry.
  -296-

  INPUT                                                          (New)

  Purpose:     Get a string from the keyboard and save it in an
               environment variable.

  Format:      INPUT [/C /D /E /Ln /N /P /Wn /X] [prompt] %%varname

               prompt:  Optional text that is displayed as a prompt.
               varname:  The variable that will hold the user's
               input.

               /C(lear buffer)          /N(o colors)
               /D(igits only)           /P(assword)
               /E(dit)                  /W(ait)
               /L(ength)                /X (no carriage return)

               See also:  INKEY and KEYSTACK.

  Usage:       INPUT optionally displays a prompt.  Then it waits
               for a specified time or indefinitely for your entry.
               It places any characters you type into an environment
               variable.  INPUT is normally used in batch files and
               aliases to get multi-character input (for single-
               keystroke input, see INKEY).

               If prompt text is included in an INPUT command, it is
               displayed while INPUT waits for input.  Standard
               command-line editing keys may be used to edit the
               input string as it is entered.  If you use the /P
               option, INPUT will echo asterisks instead of the keys
               you type.

               All characters entered up to, but not including, the
               carriage return are stored in the variable.

               The following batch file fragment prompts for a
               string and stores it in the variable FNAME:

                    input Enter the file name:  %%fname

               INPUT reads standard input, so it will accept text
               from a re-directed file or from the KEYSTACK.

               If you press Ctrl-C or Ctrl-Break while INPUT is
               waiting for input, execution of an alias will be
               terminated, and execution of a batch file will be
               suspended while you are asked whether to cancel the
               batch job (see page 93).  A batch file can handle
               Ctrl-C and Ctrl-Break itself with the ON BREAK
               command (see page 327).

           ##  You can pipe text to INPUT; if you do, it will set
               the variable to the first line it receives.  This
               approach should only be used in 4DOS.  In 4OS2 and
               4NT it will set the variable in the "child" process
               used to handle the right hand side of the pipe, but
               this variable will not be available in the original
  -297-

               copy of 4OS2 or 4NT used to start the pipe.  See page
               61 for more information on pipes.

       4NT     INPUT works within the command line window.  If you
               prefer to use a dialog for user input, see the MSGBOX
               command.

  Options:     /C(lear buffer):  Discard any keystrokes pending in
               the keyboard buffer before INPUT begins accepting
               characters.

               /D(igits only):  Prevents INPUT from accepting any
               keystrokes except digits from 0 to 9.

               /E(dit):  Allows you to edit an existing value.  If
               there is no existing value for varname, INPUT
               proceeds as if /E had not been used, and allows you
               to enter a new value.

               /Ln  (Length):  Sets the maximum number of characters
               which INPUT will accept to "n".  If you attempt to
               enter more than this number of characters, INPUT will
               beep and prevent further input (you can still edit
               characters typed before the limit was reached).

               /N(o colors):  Disables the use of input colors
               defined in the InputColor directive in the .INI file,
               and forces INPUT to use the default display colors.

               /P(assword):  Tells INPUT to echo asterisks, instead
               of the characters you type.

               /W(ait):  Timeout period, in seconds, to wait for a
               response.  If no keystroke is entered by the end of
               the timeout period, INPUT returns with the variable
               unchanged.  This allows you to continue the batch
               file if the user does not respond in a given period
               of time.  If you enter a key before the timeout
               period, INPUT will wait indefinitely for the
               remainder of the line.  You can specify /W0 to return
               immediately if there are no keys waiting.

               /X  (no carriage return):  Prevents INPUT from
               displaying a carriage return and line feed after the
               user's entry.
  -298-

  KEYBD                                                          (New)

  Purpose:     Set the state of the keyboard toggles:  Caps Lock,
               Num Lock, and Scroll Lock.

  Format:      KEYBD [/Cn /Nn /Sn]

               /C(aps lock)               /S(croll lock)
               /N(um lock)

               n can be either 0 to turn off the toggle or 1 to turn
               on the toggle.

  Usage:       Most keyboards have 3 toggle keys, the Caps Lock, Num
               Lock, and Scroll Lock.  The toggle key status is
               usually displayed by three lights at the top right
               corner of the keyboard.

               This command lets you turn any toggle key on or off.
               It is most useful in batch files and aliases if you
               want the keys set a particular way before collecting
               input from the user.

               For example, to turn off the Num Lock and Caps Lock
               keys, you can use this command:

                    c:\> keybd /c0 /n0

               If you use the KEYBD command with no switches, it
               will display the present state of the toggle keys.

       4DOS ## In 4DOS, KEYBD works by performing a BIOS setting.
               Some memory resident programs that monitor the
               physical keyboard rather than BIOS settings may not
               recognize that the state of the toggle keys has
               changed after a KEYBD command.

               The toggle key state is typically the same for all
               sessions, and changes made with KEYBD in one session
               will therefore affect all other sessions.  The only
               exception is when running 4DOS under OS/2, where
               KEYBD affects only the current 4DOS session.

  Options:     /C(aps lock):  Turn the Caps Lock key on or off.

               /N(um lock):  Turn the Num Lock key on or off.

               /S(croll lock):  Turn the Scroll Lock key on or off.
  -299-

  KEYS      [4OS2, 4NT]                                     (Enhanced)

  Purpose:     Enable, disable, or display the history list.

  Format:      KEYS [ON | OFF | LIST]

               See also:  HISTORY.

  Usage:       This command is provided for compatibility with the
               KEYS command in CMD.EXE, which controls the history
               list in OS/2 and Windows NT.  The same functions are
               available by setting the HistMin directive in the
               .INI file, and by using the HISTORY command.

               The history list collects the commands you type for
               later recall, editing, and viewing.  You can view the
               contents of the list through the history list window
               or by typing any of the following commands:

                    [c:\] history
                    [c:\] history /p
                    [c:\] keys list

               The first command displays the entire history list.
               The second displays the entire list and pauses at the
               end of each full screen.  The third command produces
               the same output as the first, except that each line
               is numbered.

               You can disable the collection and storage of
               commands in the history list by typing:

                    [c:\] keys off

               You can turn the history back on with the command:

                    [c:\] keys on

               If you issue the KEYS command without any parameters,
               4OS2 or 4NT will show you the current status of the
               history list.

       4OS2    KEYS also affects the way 4OS2 reads input from the
               keyboard.  KEYS OFF will force 4OS2 into line input
               mode; KEYS ON will return input to the usual
               character by character method.  See the LineInput
               directive on page 157, or the /L option of the SETDOS
               command on page 366, for details on line input mode.
  -300-

  KEYSTACK      [4DOS, 4OS2]                                     (New)

  Purpose:     Feed keystrokes to a program or command
               automatically.

  Format:      KEYSTACK [!] [/Wn] ["abc"] [keyname[n]] ...

               !:  Signal to clear the Keystack and the keyboard
               buffer.
               "abc":  Literal characters to be placed in the
               Keystack.
               keyname:  Name or code for a key to be placed in the
               Keystack.
               n:  Number of times to repeat the named key.

               /W(ait)

  Usage:       KEYSTACK takes a series of keystrokes and feeds them
               to a program or command as if they were typed at the
               keyboard.  When the program has used all of the
               keystrokes in the keystack buffer, it will begin to
               read the keyboard for input, as it normally would.

               KEYSTACK works differently in 4DOS and 4OS2.  The
               differences are explained in the two sections below,
               followed by important additional information which
               applies to both products.


               4DOS

               Under 4DOS, KEYSTACK places keystrokes into a buffer.
               When an application program (or 4DOS itself) requests
               another keystroke, the "stacked" keystroke is
               retrieved from the buffer.  The KEYSTACK command must
               be executed before running the program which is going
               to receive the keystrokes in order to put the
               keystrokes into the buffer first, so the program can
               find them when it runs.

               KEYSTACK will only work if the memory-resident
               program KSTACK.COM has been loaded.  KSTACK is
               usually loaded from the AUTOEXEC.BAT file (see page
               94).  If KSTACK is not loaded, the KEYSTACK command
               will display an error message.  If you are using
               Windows 95, see your Introduction and Installation
               Guide for information on loading KSTACK within a
               window.

               Programs that bypass DOS and the BIOS for keyboard
               input cannot read keystrokes entered with KEYSTACK.
               If you use KEYSTACK and then run such a program, the
               keystrokes will not appear in the program, but may
               appear at the prompt when you exit the program and
               return to 4DOS.
  -301-

               4OS2

               Under 4OS2, KEYSTACK sends the keystrokes to the
               current active window.  If you want to send
               keystrokes to another program (rather than have them
               function with 4OS2 itself), you must start the
               program or ACTIVATE its window (see page 177) so it
               can receive the keystrokes.  The KEYSTACK command
               must be executed after you start or ACTIVATE the
               program which is to receive the keystrokes.

               KEYSTACK is most often used for programs started from
               batch files.  In order for 4OS2's KEYSTACK to work in
               a batch file, you must start the program with the
               START command, then use the KEYSTACK command.  If you
               start the program directly -- without using START --
               the batch file will wait for the application to
               complete before continuing and running the KEYSTACK
               command, and the keystrokes will be placed in the
               buffer too late.

               If you use KEYSTACK in an alias executed from the
               prompt, the considerations are essentially the same,
               but depend on whether ExecWait is set (see page 79
               for details).  If ExecWait is not set, you can use
               KEYSTACK immediately after an application is started.
               However, if ExecWait is set, the KEYSTACK command
               will not be executed until the program has finished,
               and the keystrokes will be placed in the buffer too
               late.

               You may not be able to use KEYSTACK effectively if
               you have programs running in the background which
               change the active window (for example, by popping up
               a dialog box).  If a window pops up in the midst of
               your KEYSTACK sequence, keystrokes stored in the
               KEYSTACK buffer may go to that window, and not to the
               application you intended.

               KEYSTACK will only work if the program KEYSTACK.EXE
               is in the same directory 4OS2.EXE, or a directory
               listed in your PATH.  If KEYSTACK.EXE cannot be
               found, the KEYSTACK command will display an error
               message.  KEYSTACK can send keystrokes to
               Presentation Manager applications and to OS/2
               character-mode applications running in a window.  It
               cannot send keystrokes to DOS applications, or to
               character-mode applications running in a full-screen
               session.


               Additional Information

               The remainder of the information on KEYSTACK applies
               to 4DOS and 4OS2, unless otherwise noted.
  -302-

               Characters entered within double quotes ("abc") will
               be sent "as is" to the application.  The only items
               allowed outside double quotes are key names, the !
               and /W options, and a repeat count.

               See page 30 for a complete listing of key names and a
               description of the key name and numeric key code
               format.  If you want to send the same key name or
               numeric code several times, you can follow it with a
               repeat count in square brackets.  For example, to
               send the Enter key 4 times, you can use this command:

                    keystack enter [4]

               The repeat count works only with individual
               keystrokes, or numeric keystroke or character values.
               It cannot be used with quoted strings.

               An exclamation mark [!] will clear all pending
               keystrokes, both in the KEYSTACK buffer and, in 4DOS,
               in the BIOS keyboard buffer.

               For example, to start a program that needs a single
               space to skip its opening screen you could use the
               command:

                    c:\comm> keystack 32 ^ progname

               This places a space (ASCII code 32) in the buffer,
               then runs the program.  When the program looks for a
               keystroke to end the display of the opening screen
               the keystroke is already in the buffer, and the
               opening screen is removed immediately.

       4DOS    You can store a maximum of 255 text or special
               characters in the 4DOS KEYSTACK buffer.  A delay
               takes two character slots in the buffer.  A repeated
               character takes one character slot per repetition.

       4OS2    You can store a maximum of 1023 characters in the
               4OS2 KEYSTACK buffer.  The count is determined by the
               number of characters on the KEYSTACK command line,
               not by the actual number of characters sent to the
               application.

               Each time the KEYSTACK command is executed, it will
               clear any remaining keystrokes stored by a previous
               KEYSTACK command.

               You may need to experiment with your programs and
               insert delays (see the /W option) to find a keystroke
               sequence that works for a particular program.
  -303-

           ##  Advanced Options

               KEYSTACK treats the number 0 as a special case; it is
               used with programs that flush the keyboard buffer.
               When KEYSTACK processes a key value of 0, it tells
               the program the buffer is clear, so subsequent
               keystrokes will be accepted normally.  Some programs
               will require several "0"s before they will accept
               input; you may need to experiment to determine the
               correct number.

               For example, the following batch file starts a
               spreadsheet programand loads the file specified on
               the command line when the batch file is invoked (the
               KEYSTACK command should be entered on one line):

                    pushd c:\finance
                    keystack 0 Enter 0 Enter 0 Enter 0 Enter 0 Enter
                      "/FR" 0 "%1" Enter
                    spread
                    popd

               The sequence of "0 Enter" pairs tells the program
               that the keyboard buffer is empty, then passes a
               carriage return, repeating this sequence five times.
               (You must determine the actual sequence required by
               your software through experimentation.  Few programs
               require as long a startup sequence as is shown here.)
               This gets the program to a point where an empty
               spreadsheet is displayed.  The rest of the KEYSTACK
               line issues a File Retrieve command (/FR), simulates
               an empty keyboard buffer once more, enters the file
               name passed on the batch command line (%1), and
               finally enters a carriage return to end the file
               name.

               Here's the same command defined as an alias (enter
               this on one line):

                    alias sload `pushd c:\finance ^ keystack 0 Enter
                    0 Enter 0 Enter 0 Enter 0 Enter "/FR" 0 "%1"
                    Enter ^ spread ^ popd`

               KEYSTACK mimics the BIOS by stacking both an ASCII
               code and a scan code for each key.  It does so by
               calculating the code for each character, whether it
               is entered as part of a quoted string, as a key name,
               or as an ASCII value less than 128.  However, if you
               are stacking keys for a program which distinguishes
               between keys with the same symbol, like the plus on
               the keyboard and the gray plus, you will have to
               calculate the codes for the keys on the numeric
               keypad yourself.  Calculate the value ((256 * scan
               code) + ASCII code) and enter that numeric value as
               an argument for KEYSTACK.
  -304-

               For example, for the Enter key on the numeric keypad,
               the scan code is 224 and the ASCII code is 13, so to
               stack both values use ((256 * 224) + 13) or KEYSTACK
               57357.  Try this approach if a "normal" KEYSTACK
               command does not work (for example, if you use
               "KEYSTACK Enter" for the Enter key and the program
               doesn't see the correct character).  To stack such
               combined key codes you must use the numeric value,
               not the key name.  See the online help for a complete
               list of ASCII codes and scan codes.

  Options: ##  /W(ait):  Delay the next keystroke in the KEYSTACK
               buffer by a specified number of clock "ticks".  A
               clock tick is approximately 1/18 second.  The number
               of clock ticks to delay should be placed immediately
               after the W, and must be between 1 and 65535 (65535
               ticks is about 1 hour).  You can use the /W option as
               many times as desired and at any point in the string
               of keystrokes except within double quotes.  Some
               programs may need the delays provided by /W in order
               to receive keystrokes properly from KEYSTACK.  The
               only way to determine what delay is needed is to
               experiment.  Sometimes a combination of a delay and
               an "empty buffer" signal (a 0) are required.  For
               example, to start the program CADX and send it an F7,
               a delay of one second, an indication that the
               keyboard buffer is empty, and a carriage return:

                    c:\> keystack F7 /W18 0 Enter ^ cadx
  -305-

  LH / LOADHIGH      [4DOS]                               (Compatible)

  Purpose:     Load a memory resident program into an Upper Memory
               Block (UMB).

  Format:      LH [/L:r1,n1;r2,n2;... /S] filename
                    or
               LOADHIGH [/L:r1,n1;r2,n2;... /S] filename

               filename:  The name of the program to load into high
               memory.

               /L(oad region)             /S(hrink)

  Usage:       LH and LOADHIGH are synonyms.  You can use either
               one.

               LOADHIGH requires version 5.0 or later of MS-DOS, PC-
               DOS, DR DOS, or Novell DOS / OpenDOS; Windows 95; or
               an OS/2 DOS session.

               If you load memory-resident programs into UMBs, you
               will have more room in conventional memory for
               application programs.  If your system has no UMBs, or
               if the program is larger than the largest UMB, then
               LOADHIGH will load the program into conventional base
               memory.

               For example, to load the program C:\UTIL\CACHE.EXE
               into high memory:

                    c:\> loadhigh c:\util\cache.exe

               If you are running MS-DOS / PC-DOS 5.0 or above,
               Windows 95, or an OS/2 DOS session, LOADHIGH requires
               the DOS=UMB command in your CONFIG.SYS file.

           !   If you use a memory manager like 386MAX or QEMM to
               manage your UMBs, rather than the DOS or Windows 95
               memory manager and the DOS=UMB directive, then
               LOADHIGH will not work, and you must use the
               equivalent command supplied with your memory manager
               in order to load programs high.

               See the Miscellaneous Reference section of the online
               help for complete details on UMBs and UMB regions,
               and the hardware and software required to support
               them.

           ##  The /L and /S switches are designed to aid in
               optimizing the use of upper memory by selecting one
               or more UMB regions for a particular memory-resident
               program to use.  They are fully compatible with the
               MS-DOS 6.0 and above memory optimizer, MEMMAKER, and
               may also be used under MS-DOS 5.0 and in OS/2 DOS
               sessions.
  -306-

               While a complete discussion of memory optimization
               techniques is well beyond the scope of this manual,
               the basic technique is to load each memory-resident
               program into a specific region to free up the maximum
               possible amount of base memory.

               Optimizing UMB usage requires a detailed knowledge of
               the memory requirements for your memory-resident
               programs.  This information can be very difficult to
               obtain, because some programs require more memory
               when starting and less when running, and each program
               is unique.  However, if you know these memory
               requirements, you may be able to use /L and /S to
               optimize the use of upper memory, or to improve on
               the optimization done by MEMMAKER or another memory
               optimizer.

  Options: ##  /L:r1,n1;r2,n2;...  (Load region):  Specifies which
               region(s) should be used for the program, and
               optionally the minimum free space required in a
               region before the program is allowed access to that
               region.

               If /L is not used, all upper memory regions are
               available to the program.  If /L is used, you must
               specify one or more regions (r1, r2, etc.); only
               those regions will be made available.  Upper memory
               regions are numbered sequentially beginning with 1
               (region 0 refers to low memory, and is normally used
               only by MEMMAKER).

               If only a region number is given, the entire region
               is made available to the program (assuming there is
               free space in the region).  If a size is given for a
               particular region (n1, n2, etc.), then the region is
               only made available if the free space in the region
               is equal to or greater than that size.  All sizes are
               in bytes.  Any region not available to a particular
               program is "locked out" while that program is loading
               and made available again once the program is loaded.
               If the combination of /L values you use does not
               provide sufficient upper memory space for the program
               to load, it will be loaded in low memory.

               You can combine /L values in several ways.  In each
               of the following examples, if the requested space is
               not available or is insufficient the program is
               loaded into low memory:

                    lh /l:2 filename
                         The program can use region 2 only.

                    lh /l:2;3 filename
                         The program can use regions 2 and 3 only.

                    lh /l:2,2048 filename
  -307-

                         The program can use region 2 only, and only
                         if it has 2048 or more bytes free.

                    lh /l:2,2048;3 filename
                         The program can use region 2 if it has 2048
                         or more bytes free, and region 3 regardless
                         of how many bytes it has free

           ##  /S(hrink):  Shrinks each region selected by /L to the
               minimum size used in /L before loading the program.
               This prevents memory-resident programs which take all
               available memory from using more than you want them
               to.  This switch is primarily intended for use by
               MEMMAKER.
  -308-

  LIST                                                           (New)

  Purpose:     Display a file, with forward and backward paging and
               scrolling.

  Format:      LIST [/A:[[-]rhsda] /H /I /R /S /T /W /X] file...

               file:  A file or list of files to display.

               /A: (Attribute select)   /S(tandard input)
               /H(igh bit off)          /T (search for text)
               /I(gnore wildcards)      /W(rap)
               /R(everse)               /X (heX display mode)

               See also:  TYPE.

  File Selection:   Supports extended wildcards, ranges, multiple
               file names, and include lists (see pages 64 - 73).

  Usage:       LIST provides a fast and flexible way to view a file,
               without the overhead of loading and using a text
               editor.

               For example, to display a file called MEMO.DOC:

                    c:\> list memo.doc

               LIST is most often used for displaying ASCII text
               files.  It can be used for other files which contain
               non-alphabetic characters, but you may need to use
               hex mode (see below) to read these files.

               LIST uses the cursor pad to scroll through the file.
               The following keys have special meanings:

                    Home             Display the first page of the
                                     file.
                    End              Display the last page of the
                                     file.
                    Esc              Exit the current file.
                    Ctrl-PgUp        Display previous file.
                    Ctrl-PgDn        Display next file.
                    Ctrl-C           Quit LIST.
                    Up Arrow         Scroll up one line.
                    Down Arrow       Scroll down one line.
                    PgUp             Scroll up one page.
                    PgDn or Space    Scroll down one page.
                    Left Arrow       Scroll left 8 columns.
                    Right Arrow      Scroll right 8 columns.
                    Ctrl-Left Arrow  Scroll left 40 columns.
                    Ctrl-Right Arrow Scroll right 40 columns.
                    F1               Display online help
                    B                Go back to the previous file in
                                     the current group of files.
                    F                Prompt and search for a string.
  -309-

                    Ctrl-F           Prompt and search for a string,
                                     searching backward from the end
                                     of the file.
                    G                Go to a specific line or, in
                                     hex mode, to a specific
                                     hexadecimal offset.
                    H                Toggle the "strip high bit"
                                     (/H) option.
                    I                Display information on the
                                     current file (the full name,
                                     size, date, and time).
                    N                Find next matching string.
                    Ctrl-N           Find previous match in the
                                     file.
                    P                Print the current page or the
                                     entire file.
                    W                Toggle the "line wrap" (/W)
                                     option.
                    X                Toggle the hex-mode display
                                     (/X) option.

               Text searches performed with F, N, Ctrl-F, and Ctrl-N
               are not case-sensitive.  However, if the display is
               currently in hexadecimal mode and you press F or
               Ctrl-F, you will be prompted for whether you want to
               search in hexadecimal mode.  If you answer Y, you
               should then enter the search string as a sequence of
               2-digit hexadecimal numbers separated by spaces, for
               example 41 63 65 (these are the ASCII values for the
               string "Ace").  Hexadecimal searches are case-
               sensitive, and search for exactly the string you
               enter.

               When the search string is found LIST displays the
               line containing the string at the top of the screen,
               and highlights the string it found.  Any additional
               occurrences of the string on the same display page
               are also highlighted.  Highlighting is intended for
               use with text files; in binary files the search
               string will be found, but may not be highlighted
               properly.

               You can use wildcards in the search string.  For
               example, you can search for the string "to*day" to
               find the next line which contains the word "to"
               followed by the word "day" later on the same line, or
               search for the numbers "101" or "401" with the search
               string "[14]01".  See page 64 for complete
               information on wildcards.  If you begin the search
               string with a back-quote [`], or enclose it in back-
               quotes, wildcard characters in the string will be
               treated as normal text with no special wildcard
               meaning.

               LIST saves the search string used by F, N, Ctrl-F,
               and Ctrl-N so you can LIST multiple files and search
               for the same string simply by pressing N in each
  -310-

               file, or repeat your search the next time you use
               LIST.

               You can use the /T switch to specify search text for
               the first file.  When you do so, LIST begins a search
               as soon as the file is loaded.  Use /I to ignore
               wildcards in the initial search string, and /R to
               make the initial search go backwards from the end of
               the file.  When you LIST multiple files with a single
               LIST command, these switches affect only the first
               file; they are ignored for the second and subsequent
               files.

               LIST normally allows long lines in the file to extend
               past the right edge of the screen.  You can use the
               horizontal scrolling keys (see above) to view text
               that extends beyond the screen width.  If you use the
               W command or /W switch to wrap the display, each line
               is wrapped when it reaches the right edge of the
               screen, and the horizontal scrolling keys are
               disabled.

               To view text from the clipboard, use CLIP: as the
               file to be listed.  CLIP: will not return any data
               unless the clipboard contains text.  See page 58 for
               additional information on CLIP:, including details on
               when you can use the clipboard under 4DOS.

               If you print the file which LIST is displaying, you
               will be asked whether you wish to print the entire
               file or the current display page.  The print format
               will match the display format.  If you have switched
               to hexadecimal or wrapped mode, that mode will be
               used for the printed output as well.  If you print in
               wrapped mode, long lines will be wrapped at the width
               of the display.  If you print in normal display mode
               without line wrap, long lines will be wrapped or
               truncated by the printer, not by LIST.

               Printed output normally goes to device LPT1.  If you
               wish to send the printed output to another device,
               use the Commands page of the OPTION dialogs, or the
               Printer directive in the .INI file (see page 158).

           ##  If you specify a directory name instead of a filename
               as an argument, LIST will display each of the files
               in that directory.

           ##  Most of the LIST keystrokes can be reassigned with
               .INI file key mapping directives (see pages 161 and
               165).

           ##  You can set the colors used by LIST on the Commands
               page of the OPTION dialogs, or the ListColors and
               ListStatBarColors directives in the .INI file.  If
               ListColors is not used, the LIST display will use the
               current default colors.  If ListStatBarColors is not
  -311-

               used, the status bar will use the reverse of the LIST
               display colors.

           ##  By default, LIST sets tab stops every 8 columns.  You
               can change this behavior on the Display page of the
               OPTION dialogs, or with the TabStops .INI file
               directive (see page 159).

       4DOS ## LIST normally writes text directly to the screen.  If
               you have an unusual display adapter which does not
               support direct video output, see the OutputBIOS
               directive on page 167.

  Options: ##  /A:  (Attribute select): Select only those files that
               have the specified attribute(s) set.  See Attribute
               Switches on page 174 for information on the
               attributes which can follow /A:.

           ##  /H(igh bit off):  Strip the high bit from each
               character before displaying it.  This is useful when
               displaying files created by some word processors that
               turn on the high bit for formatting purposes.  You
               can toggle this option from within LIST with the H
               key.

               /I(gnore wildcards):  Only meaningful when used in
               conjunction with the /T "text" option.  Directs LIST
               to interpret characters such as *, ?, [, and ] as
               literal characters instead of wildcard characters.
               /I affects only the initial search started by /T, not
               subsequent searches started from within LIST.

               /R(everse):  Only meaningful when used in conjuction
               with the /T "text" option.  Directs LIST to search
               for text from the end of the file instead of from the
               beginning of the file.  Using this switch can speed
               up searches for text that is normally near the end of
               the file, such as a signature.  /R affects only the
               initial search started by /T, not subsequent searches
               started from within LIST.

               /S(tandard input):  Read from standard input rather
               than a file.  This allows you to redirect command
               output and view it with LIST.  Normally, LIST will
               detect input from a redirected command and adjust
               automatically.  However, you may find circumstances
               when /S is required.  For example, to use LIST to
               display the output of DIR you could use either of
               these commands:

                    c:\> dir | list
                    c:\> dir | list /s

               /T(ext):  Search for text in the first file.  This
               option is the same as pressing F, but it allows you
               to specify the search text on the command line.  The
               text must be contained in quotation marks if it
  -312-

               contains spaces, punctuation, or wildcard characters.
               For example, to search for the string 4DOS in the
               file README.DOC, you can use this command:

                    c:\> list /t4dos readme.doc

               The search text may include wildcards and extended
               wildcards (see page 64).  For example, to search for
               the words Hello and John on the same line in the file
               LETTER.DAT:

                    c:\> list /t"Hello*John" letter.dat

               When you LIST multiple files with a single LIST
               command, /T only initiates a search in the first
               file.  It is ignored for the second and subsequent
               files.  Also see /I and /R.

               /W(rap):  Wrap the text at the right edge of the
               screen.  This option is useful when displaying files
               that don't have a carriage return at the end of each
               line.  The horizontal scrolling keys do not work when
               the display is wrapped.  You can toggle this option
               on and off from within LIST with the W key.

               /X  (hex mode):  Display the file in hexadecimal
               (hex) mode.  This option is useful when displaying
               executable files and other files that contain non-
               text characters.  Each byte of the file is shown as a
               pair of hex characters.  The corresponding text is
               displayed to the right of each line of hexadecimal
               data.  You can toggle this mode on and off from
               within LIST with the X key.
  -313-

  LOADBTM                                                        (New)

  Purpose:     Switch a batch file to or from BTM mode.

  Format:      LOADBTM [ON | OFF]

  Usage:       4DOS, 4OS2, and 4NT recognize two kinds of batch
               files: .BAT or .CMD, and .BTM.  Batch files executing
               in BTM mode run two to ten times faster than in BAT
               or CMD mode.  (However, BTM mode should not be used
               to load memory-resident programs in DOS, nor should
               BTM mode be used for self-modifying batch files.)
               Batch files automatically start in the mode indicated
               by their extension.  For more information on .BTM,
               .BAT, and .CMD files, see page 88.

               The LOADBTM command turns BTM mode on and off.  It
               can be used to switch modes in either a .BAT / .CMD
               or .BTM file.  If you use LOADBTM with no argument,
               it will display the current batch mode:  LOADBTM ON
               or LOADBTM OFF.

               Using LOADBTM to repeatedly switch modes within a
               batch file is not efficient.  In most cases the speed
               gained by running some parts of the file in BTM mode
               will be more than offset by the speed lost through
               repeated loading of the file each time BTM mode is
               invoked.

               LOADBTM can only be used within a batch file.  It is
               most often used under DOS to switch a .BAT file into
               BTM mode after memory-resident programs are loaded,
               to convert a .BAT or .CMD file to BTM mode without
               changing its extension, or to switch a .BTM file into
               BAT mode in order to load memory-resident programs
               under DOS.

               The following .BAT file fragment loads some memory
               resident programs (TSRs), and then switches to BTM
               mode:

                    rem   Because this file has a .BAT extension,
                    rem   the initial default state is LOADBTM OFF
                    rem   Loading TSRs...
                    ansi.com
                    mouse.com
                    rem   Switch to high-speed (BTM) mode now that
                    rem   TSRs are loaded
                    loadbtm on
                    path c:\;c:\util;c:\dos
                    alias /r c:\aliases
                    .....
  -314-

  LOCK      [4DOS]                                        (Compatible)

  Purpose:     Lock a disk drive to allow exclusive access under
               Windows 95.

  Format:      LOCK [drive: ...]

               drive:  The drive or list of drives to lock.

               See also:  UNLOCK.

  Usage:       LOCK is only available when 4DOS is running under
               Windows 95.  LOCK locks the specified drive(s) so
               that the 4DOS session, and the programs you run in
               it, have exclusive access to those drive(s).  This
               allows you to run programs (such as disk maintenance
               utilities) which access the disk drive directly,
               without rebooting in DOS.

               If no drives are specified, 4DOS will attempt to lock
               all drives.

           !   USE EXTREME CAUTION with programs which access the
               disk drive directly (and therefore require LOCK) and
               which were not written for Windows 95.  If such
               programs are unaware of Windows 95's changes to the
               FAT directory structure, they can damage or destroy
               files, filenames, and system data.  This damage can
               be caused whether you run such programs under Windows
               95, or from a DOS boot without the Windows 95 GUI.
  -315-

  LOG                                                            (New)

  Purpose:     Save a log of commands to a disk file.

  Format:      LOG [/H /W file] [ON | OFF | text]

               file:  The name of the file to hold the log.
               text:  An optional message that will be added to the
               log.

               /H(istory log)             /W(rite to)

               See also:  HISTORY.

  Usage:       LOG keeps a record of all internal and external
               commands you use, whether they are executed from the
               prompt or from a batch file.  Each entry includes the
               current system date and time, along with the actual
               command after any alias or variable expansion (see
               page 138 for more information on alias and variable
               expansion).  You can use the log file as a record of
               your daily activities.

               LOG with the /H option keeps a similar record called
               a "history log".  The history log records only
               commands entered at the prompt; it does not record
               batch file commands.  In addition, the history log
               does not record the date and time for each command,
               and it records commands before aliases and variables
               are expanded.

               The two logging options are independent.  You can
               have both a regular log and a history log enabled
               simultaneously.

               By default, LOG writes to the file 4DOSLOG, 4OS2LOG,
               or 4NTLOG (depending on which command processor you
               are using), in the root directory of the boot drive.
               The corresponding default file names for the history
               log are 4DOSHLOG, 4OS2HLOG, and 4NTHLOG.  You can set
               the default log file names on the Options 2 page of
               the OPTION dialogs, or with the LogName and
               HistLogName directives in the .INI file.

               Entering LOG or LOG /H with no parameters displays
               the name of the log file and the log status (ON or
               OFF):

                    c:\> log
                    LOG (C:\4DOSLOG) is OFF

               To enable or disable logging, add the word "ON" or
               "OFF" after the LOG command, for example:

                    c:\> log on

                    c:\> log /h on
  -316-

               Entering LOG or LOG /H with text writes a message to
               the log file, even if logging is set OFF.  This
               allows you to enter headers in the log file:

                    c:\> log "Started work on the database system"

               The LOG file format looks like this:

                    [date time]  command

               where the date and time are formatted according to
               the country code set for your system.

               The LOG /H output can be used as the basis for
               writing batch files.  Start LOG /H, then execute the
               commands that you want the batch file to execute.
               When you are finished, turn LOG /H off.  The
               resulting file can be turned into a batch file that
               performs the same commands with little or no editing.

               You can have both a regular log (with time and date
               stamping) and a history log (without the time stamps)
               enabled simultaneously.

  Options:     /H(istory log):  This option makes the other options
               on the command line (after the /H) apply to the
               history log.  For example, to turn on history logging
               and write to the file C:\LOG\HLOG:

                    c:\>  log /h /w c:\log\hlog

               /W(rite):  This switch specifies a different filename
               for the LOG or LOG /H output.  It also automatically
               performs a LOG ON command.  For example, to turn
               logging on and write the log to C:\LOG\LOGFILE:

                    c:\> log /w c:\log\logfile

               Once you select a new file name with the LOG /W or
               LOG /H/W command, LOG will use that file until you
               issue another LOG /W or LOG /H/W command, or until
               you reboot your computer.  Turning LOG or LOG /H off
               or on does not change the file name.
  -317-

  MD / MKDIR                                                (Enhanced)

  Purpose:     Create a subdirectory.

  Format:      MD [/N /S] path...
                    or
               MKDIR [/N /S] path...

               path:  The name of one or more directories to create.

               /N(o update)             /S(ubdirectories)

               See also:  RD.

  Usage:       MD and MKDIR are synonyms.  You can use either one.

               MD creates a subdirectory anywhere in the directory
               tree.  To create a subdirectory from the root, start
               the path with a backslash [\].  For example, this
               command creates a subdirectory called MYDIR in the
               root directory:

                    c:\> md \mydir

               If no path is given, the new subdirectory is created
               in the current directory.  This example creates a
               subdirectory called DIRTWO in the current directory:

                    c:\mydir> md dirtwo

               To create a directory from the parent of the current
               directory (that is, to create a sibling of the
               current directory), start the path with two periods
               and a backslash [..\].

               The operating system limits the permissible length of
               the full subdirectory name.  See page 13 for details.

               When creating a directory on an HPFS, NTFS, or LFN
               drive, you must quote any path which contains
               whitespace or special characters.  See page 14 for
               additional details.

               If MD creates one or more directories, they will be
               added automatically to the extended directory search
               database unless the /N option is specified.  See page
               53 for more information on extended directory
               searches.

  Options:     /N(o update):  Do not update the extended directory
               search database, JPSTREE.IDX (see page 53 for more
               details on extended searches).  This is useful when
               creating a temporary directory which you do not want
               to appear in the extended search database.

               /S(ubdirectories):  MD creates one directory at a
               time unless you use the /S option.  If you need to
  -318-

               create the directory C:\ONE\TWO\THREE and none of the
               named directories exist, you can use /S to have MD
               create all of the necessary subdirectories for you in
               a single command:

                    c:\> md /s \one\two\three

       4NT     For compatibility with Windows NT's CMD.EXE, /S
               becomes the default if you enable command processor
               extensions with the /X switch on the 4NT startup
               command line.  See your Introducion and Installation
               Guide for details on /X.
  -319-

  MEMORY                                                         (New)

  Purpose:     Display the amount and status of system RAM.

  Format:      MEMORY

  Usage:       MEMORY displays information about the RAM in your
               system.

       4DOS    In 4DOS, MEMORY lists the amount of total RAM in your
               system and the amount available for applications
               after DOS, 4DOS, and memory-resident programs have
               been loaded; the amount of EMS expanded memory, XMS
               extended memory, and non-XMS extended memory; the HMA
               status; and the amount of memory 4DOS is using for
               environment variable space, alias space, and history
               space.

                    c:\> memory
                        655,360 bytes total RAM
                        534,464 bytes free

                      1,687,552 bytes total EMS memory
                      1,097,728 bytes free

                        914,432 bytes total XMS memory (HMA in use)

                            512 bytes total environment
                            195 bytes free

                          1,024 bytes total alias
                            452 bytes free

                          1,024 bytes total history

               You can use the information from the MEMORY display
               to fine tune your system, to aid in setting the
               proper alias and environment sizes for 4DOS, and to
               be sure that you have sufficient memory for your
               largest applications.

               If you compare the free RAM displayed by MEMORY with
               the free RAM displayed by CHKDSK and some memory map
               programs, MEMORY will usually show a slightly higher
               value.  The difference is the size of the environment
               passed to these external programs; most memory
               mapping programs do not count the passed environment
               as free space, but MEMORY does.

       4OS2    MEMORY lists the total physical and resident RAM, the
               largest free block in RAM, the swap file size, the
               total and free environment and alias space, and the
               total history space.  If you use a non-standard swap
               file location, the swap file size will be displayed
               as 0 unless you set the SwapFilePath directive; see
               page 151 for details.
  -320-

       4NT     MEMORY lists the percentage "memory load" as reported
               by Windows NT, the total and available physical RAM,
               the total and available page file size, the total and
               free environment and alias space, and the total
               history space.

               The memory load is a figure returned by the operating
               system which gives an overall sense of memory
               utilization.  It is not a precise indicator of system
               load or memory usage.  The total page file figure
               shows the total number of bytes that can be stored in
               the file, but may not reflect the actual size of the
               current file on disk.
  -321-

  MOVE                                                           (New)

  Purpose:     Move files to a new directory and drive.

  Format:      MOVE  [/A:[[-]rhsda] /C /D /E /F /H /M /N /P /Q /R /S
               /T /U /V] source...  destination

               source:  A file or list of files to move.
               destination:  The new location for the files.

               /A: (Attribute select)   /P(rompt)
               /C(hanged)               /Q(uiet)
               /D(irectory)             /R(eplace)
               /E (No error messages)   /S(ubdirectory tree)
               /F(orce delete)          /T(otal)
               /H(idden and system)     /U(pdate)
               /M(odified files)        /V(erify)
               /N(othing)

               See also:  COPY and RENAME.

  File Selection:   Supports extended wildcards, ranges, multiple
               file names, and include lists (see pages 64 - 73).
               Ranges anywhere on the line apply to all source
               files.  Use extended wildcards with caution on LFN
               volumes; see page 74 for details.

  Usage:       The MOVE command moves one or more files from one
               directory to another, whether the directories are on
               the same drive or not.  It has the same effect as
               copying the files to a new location and then deleting
               the originals.  Like COPY and RENAME, MOVE works with
               single files, multiple files, and sets of files
               specified with an include list.

               The simplest MOVE command moves a single source file
               to a new location and, optionally, gives it a new
               name.  These two examples both move one file from
               drive C: to the root directory on drive A:

                    c:\> move myfile.dat a:\
                    c:\> move myfile.dat a:\savefile.dat

               In both cases, MYFILE.DAT is removed from drive C:
               after it has been copied to drive A:.  If a file
               called MYFILE.DAT in the first example, or
               SAVEFILE.DAT in the second example, already existed
               on drive A:, it would be overwritten.  (This
               demonstrates the difference between MOVE and RENAME.
               MOVE will move files between drives and will
               overwrite the destination file if it exists; RENAME
               will not.)

               When you move a single file, the destination can be a
               directory name or a file name.  If it is a directory
               name, and you add a backslash [\] to the end of the
               name, MOVE will display an error message if the name
  -322-

               does not refer to an existing directory.  You can use
               this feature to keep MOVE from treating a mistyped
               destination directory name as a file name, and
               attempting to move the source file to that name.

               If you move multiple files, the destination must be a
               directory name.  MOVE will move each file into the
               destination directory with its original name.  If the
               destination is not a directory, MOVE will display an
               error message and exit.  For example, if
               C:\FINANCE\MYFILES is not a directory, this command
               will display an error; otherwise, the files will be
               moved to that directory:

                    c:\> move *.wks *.txt c:\finance\myfiles

               The /D option can be used for single or multiple file
               moves; it checks to see whether the destination is a
               directory, and will prompt to see if you want to
               create the destination directory if it doesn't exist.

               If MOVE creates one or more destination directories,
               they will be added automatically to the extended
               directory search database; see page 53 for details.

               You cannot move a file to a character device like the
               printer, or to itself.

           !   Be careful when you use MOVE with the SELECT command.
               If you SELECT multiple files and the destination is
               not a directory (for example, because of a
               misspelling), MOVE will assume it is a file name.  In
               this case each file will be moved in turn to the
               destination file, overwriting the previous file, and
               then the original will be erased before the next file
               is moved.  At the end of the command, all of the
               original files will have been erased and only the
               last file will exist as the destination file.

               You can avoid this problem by using square brackets
               with SELECT instead of parentheses (be sure that you
               don't allow the command line to get too long -- watch
               the character count in the upper left corner while
               you're selecting files).  MOVE will then receive one
               list of files to move instead of a series of
               individual filenames, and it will detect the error
               and halt.  You can also add a backslash [\] to the
               end of the destination name to ensure that it is the
               name of a subdirectory (see above).


           ##  Advanced Features and Options

               MOVE first attempts to rename the file(s), which is
               the fastest way to move files between subdirectories
               on the same drive.  If that fails (e.g., because the
               destination is on a different drive or already
  -323-

               exists), MOVE will copy the file(s) and then delete
               the originals.

               If you are using 4DOS in an OS/2 DOS session, MOVE
               will copy OS/2 extended attributes from the source to
               the destination, provided the file system on the
               destination drive supports them.

               If MOVE must physically copy the files and delete the
               originals, rather than renaming them (see above),
               then some disk space may be freed on the source
               drive.  The free space may be the result of moving
               the files to another drive, or of overwriting a
               larger destination file with a smaller source file.
               MOVE displays the amount of disk space recovered
               unless the /Q option is used (see below).  It does so
               by comparing the amount of free disk space before and
               after the MOVE command is executed.  However, this
               amount may be incorrect if you are using a deletion
               tracking system which retains deleted files for later
               recovery, or if another program performs a file
               operation while the MOVE command is executed.

               When physically copying files, MOVE preserves the
               hidden, system, and read-only attributes of the
               source files, and sets the archive attribute of the
               destination files.  However, if the files can be
               renamed, and no copying is required, then the file
               attributes are not changed.

           !   Use caution with the /A: and /H switches (both of
               which can allow MOVE to process hidden files) when
               you are physically moving files, and both the source
               and destination directories contain file
               descriptions.  If the source file specification
               matches the description file name (normally
               DESCRIPT.ION), and you tell MOVE to process hidden
               files, the DESCRIPT.ION file itself will be moved,
               overwriting any existing file descriptions in the
               destination directory.  For example, if the C:\DATA
               directory contains file descriptions, this command
               would overwrite any existing descriptions in the
               D:\SAVE directory:

                    c:\data> move /h d*.* d:\save\

               (If you remove the hidden attribute from the
               DESCRIPT.ION file the same caution applies even if
               you do not use /A: or /H, as DESCRIPT.ION is then
               treated like any other file.)

       4OS2    If you move a file from a FAT volume to an HPFS
               volume, and you do not give an explicit destination
               name (i.e. you are moving the file to the current
               directory, or your destination name is made up
               entirely of wildcards), MOVE will look for a
               .LONGNAME extended attribute for the source file.  If
  -324-

               it finds that attribute, it will use the long
               filename for the destination file.  If it does not,
               it will use the short name.

               Similarly, if you MOVE files with long filenames from
               an HPFS volume to a FAT volume, 4OS2 will create the
               destination files with short, FAT-compatible names
               and save the long filenames in the .LONGNAME extended
               attribute.  The short name is created by replacing
               special characters with underscores, adding numeric
               digits to the filename (if necessary) to make the new
               name unique, and truncating the name to fit with in
               the "8.3" FAT name structure.

  Options: ##  /A:  (Attribute select): Select only those files that
               have the specified attribute(s) set.  See Attribute
               Switches on page 174 for information on the
               attributes which can follow /A:.  See the cautionary
               note under Advanced Features and Options above before
               using /A: when both source and destination
               directories contain file descriptions.

               /C(hanged files):  Move files only if the destination
               file exists and is older than the source (see also
               /U).  This option is useful for updating the files in
               one directory from those in another without moving
               any newly-created files.

               /D(irectory):  Requires that the destination be a
               directory.  If the destination does not exist, MOVE
               will prompt to see if you want to create it.  If the
               destination exists as a file, MOVE will fail with an
               "Access denied" error.  Use this option to avoid
               having MOVE accidentally interpret your destination
               name as a file name when it's really a mistyped
               directory name.

               /E (No error messages):  Suppress all non-fatal error
               messages, such as "File Not Found."  Fatal error
               messages, such as "Drive not ready," will still be
               displayed.  This option is most useful in batch files
               and aliases.

       4DOS,## /F(orce delete):  This option is only for use in
       4OS2    4OS2, and in 4DOS when running in an OS/2 DOS
               session.  It forces deletion of the source file
               without saving it to the DELDIR directory (if DELDIR
               is not in use, /F has no effect).  /F is only
               effective when MOVE must copy the source file(s) and
               delete the originals (i.e., if the destination is on
               a different drive or the destination file already
               exists).  If the files are simply renamed, /F has no
               effect.

           ##  /H(idden):  Move all files, including hidden and
               system files. See the cautionary note under Advanced
               Features and Options above before using /H when both
  -325-

               source and destination directories contain file
               descriptions.

               /M(odified files):  Move only files that have the
               archive bit set.  The archive bit will remain set
               after the MOVE; to clear it use ATTRIB (page 189).

               /N(othing):  Do everything except actually move the
               file(s).  This option is most useful for testing what
               a complex MOVE command will do.  /N does not prevent
               creation of destination subdirectories when it is
               used with /S.

               /P(rompt):  Prompt the user to confirm each move.
               Your options at the prompt are explained in detail on
               page 50.

               /Q(uiet):  Don't display filenames, the total number
               of files moved, or the amount of disk space
               recovered, if any.  This option is most often used in
               batch files.  See also /T.

               /R(eplace):  Prompt for a Y or N response before
               overwriting an existing destination file.

               /S(ubdirectories):  Move an entire subdirectory tree
               to another location.  MOVE will attempt to create the
               destination directories if they don't exist, and will
               remove empty subdirectories after the move.  When /D
               is used with /S, you will be prompted if the first
               destination directory does not exist, but
               subdirectories below that will be created
               automatically by MOVE.  If MOVE /S creates one or
               more destination directories, they will be added
               automatically to the extended directory search
               database; see page 53 for details.

               If you attempt to use /S to move a subdirectory tree
               into part of itself, MOVE will detect the resulting
               infinite loop, display an error message, and exit.

               /T(otal):  Don't display filenames as they are moved,
               but display the total number of files moved and the
               amount of free disk space recovered, if any.

               /U(pdate):  Move each source file only if it is newer
               than a matching destination file or if a matching
               destination file does not exist (also see /C).  This
               option is useful for moving new or changed files from
               one directory to another.

           ##  /V(erify):  Verify each disk write.  This is the same
               as executing the VERIFY ON command, but is only
               active during the MOVE.  /V does not read back the
               file and compare its contents with what was written;
               it only verifies that the data written to disk is
               physically readable.
  -326-

  MSGBOX      [4NT]                                              (New)

  Purpose:     Display a message box and collect the user's
               response.

  Format:      MSGBOX  OK | OKCANCEL | YESNO | YESNOCANCEL ["title"]
               prompt

               title:  Text for the title bar of the message box.
               prompt:  Text that will appear inside the message
               box.

               See also:  INKEY and INPUT.

  Usage:       MSGBOX can display one of four kinds of message boxes
               and wait for a response.  You can use title and
               prompt to display any text you wish.  4NT
               automatically sizes and locates the box on the
               screen.

               The message box may have 1, 2, or 3 response buttons.
               The command MSGBOX OK creates a single-button box;
               the user must simply acknowledge the prompt text.

               The OKCANCEL and YESNO forms have 2 buttons each.
               The YESNOCANCEL form has 3 buttons.  The button the
               user chooses is returned in the 4NT variable %_?.  Be
               sure to save the return value in another variable or
               test it immediately, because the value of %_? changes
               with every internal command.

               The following list shows the value returned for each
               selection:

                    Yes       10          No        11
                    OK        10          Cancel    12

               If you exit the message box without selecting one of
               these options, MSGBOX will set %_? to 0.  If there is
               an error in the MSGBOX command itself, %_? will be
               set as described on page 113.

               For example, to display a Yes or No message box and
               take action depending on the result, you could use
               commands like this:

                    msgbox yesno "Copy" Copy all files to A:?
                    if %_? == 10 copy *.* a:

               MSGBOX creates a popup dialog box.  If you prefer to
               retrieve input from inside the command line window,
               see INKEY and INPUT.
  -327-

  ON                                                             (New)

  Purpose:     Execute a command in a batch file when a specific
               condition occurs.

  Format:      ON BREAK [command]
                    or
               ON ERROR [command]
                    or
               ON ERRORMSG [command]

  Usage:       ON can only be used in batch files.

               ON sets a "watchdog" that remains in effect for the
               duration of the current batch file.  Whenever a BREAK
               or ERROR condition occurs after ON has been executed,
               the corresponding command is automatically executed.

               ON BREAK will execute the command if the user presses
               Ctrl-C or Ctrl-Break.

               ON ERROR and ON ERRORMSG will execute the command
               after any critical error (see page 79), operating
               system error (such as a disk write error), or 4DOS,
               4OS2, or 4NT error (such as a COPY command that fails
               to copy any files, or the use of an invalid command
               option).

               ON ERROR executes the command immediately after the
               error occurs, without displaying any command
               processor error message (operating system errors may
               still be displayed).  ON ERRORMSG displays the
               appropriate error message, then executes the command.
               If both are specified, ON ERROR will take precedence,
               and ON ERRORMSG will be ignored.  The remainder of
               this section discusses both settings, using the term
               "ON ERROR[MSG]".

               ON BREAK and ON ERROR[MSG] are independent of each
               other.  You can use either one, or both, in any batch
               file.

               Each time ON BREAK or ON ERROR[MSG] is used, it
               defines a new command to be executed for a break or
               error, and any old command is discarded.  If you use
               ON BREAK or ON ERROR[MSG] with no following command,
               that type of error handling is disabled.  Error
               handling is also automatically disabled when the
               batch file exits.

               ON BREAK and ON ERROR[MSG] only affect the current
               batch file.  If you CALL another batch file, the
               first batch file's error handling is suspended, and
               the CALLed file must define its own error handling.
               When control returns to the first batch file, its
               error handling is reactivated.
  -328-

               The command can be any command that can be used on a
               batch file line by itself.  Frequently, it is a GOTO
               or GOSUB command.  For example, the following
               fragment traps any user attempt to end the batch file
               by pressing Ctrl-C or Ctrl-Break.  It scolds the user
               for trying to end the batch file, then continues:

                    on break gosub gotabreak
                    do i = 1 to 1000
                      echo %i
                    enddo
                    quit
                    :gotabreak
                    echo Hey!  Stop that!!
                    return

               You can use a command group (see page 81) as the
               command if you want to execute multiple commands, for
               example:

                    on break (echo Oops, got a break! ^ quit)

               ON BREAK and ON ERROR[MSG] always assume that you
               want to continue executing the batch file.  After the
               command is executed, control automatically returns to
               the next command in the batch file (the command after
               the one that was interrupted by the break or error).
               To avoid continuing the batch file after a break or
               error the command can transfer control with GOTO, end
               the batch file with QUIT or CANCEL, or start another
               batch file (without CALLing it).

               When handling an error condition with ON ERROR[MSG],
               you may find it useful to use internal variables (see
               page 110), particularly %_? and %_SYSERR, to help
               determine the cause of the error.

               The ON ERROR[MSG] command will not be invoked if an
               error occurs while reading or writing redirected
               input or output, or a pipe.

           !   If a break or error occurs while the command
               specified in ON BREAK or ON ERROR[MSG] is executing,
               the command will be restarted.  This means you must
               use caution to avoid or handle any possible errors in
               the commands invoked by ON ERROR[MSG], since such
               errors can cause an infinite loop and/or a stack
               overflow.
  -329-

  OPTION                                                         (New)

  Purpose:     Modify the command processor configuration.

  Format:      OPTION [//optname=value ...]

               optname:  An INI file directive to set or modify.
               value:  A new value for that directive.

               See also:  The .INI file on page 142.

  Usage:       OPTION displays a set of dialogs (in 4DOS and 4NT) or
               a settings notebook (in 4OS2) which allows you to
               modify many of the configuration options stored in
               the .INI file.

               When you exit from the dialogs or notebook, you can
               select Save to save your changes in the .INI file for
               use in the current session and all future sessions,
               select Use or OK to use your changes in the current
               session only, or select Cancel to discard the
               changes.  In 4OS2 and 4NT these selections are made
               with buttons; in 4DOS they are made from the Exit
               selection on the menu bar.

               Save saves all changes since the last Save, or since
               the last time you started the command processor.  If
               you run OPTION and exit with Use or OK, any changes
               will not be saved in the .INI file at that time.
               However, if you run OPTION again and exit with Save,
               any earlier changes will automatically be saved in
               the .INI file along with any new changes.

               In most cases, changes you make in the Startup
               section of the OPTION dialogs or notebook will only
               take effect when you reboot your system (under DOS,
               Windows, or Windows 95), or restart your command
               processor (under OS/2 or Windows NT).

               Other changes take effect as soon as you exit the
               dialogs or notebook with Save or Use.  However, not
               all option changes will appear immediately, even if
               they have taken effect.  For example, some color
               changes will only appear after a CLS command.

               OPTION handles most standard .INI file settings.
               More advanced settings, including all those listed
               under Key Mapping Directives (page 161) and Advanced
               Directives (page 166) cannot be modified with the
               OPTION dialogs or notebook.  These settings must be
               inserted or modified in the .INI file manually.  For
               more details see Chapter 5 on page 142.

               OPTION does not preserve comments when saving
               modified settings in the .INI file.  To be sure .INI
               file comments are preserved, put them on separate
               lines in the file (see page 145 for details).
  -330-

               Under 4DOS, OPTION runs the external program
               OPTION.EXE to display the dialogs or notebook; 4OS2
               uses OPTION2.EXE.  If the command processor cannot
               find this file it will display an error message.
               This program must be run with the OPTION command, and
               will not work if you invoke it directly.  Under 4NT,
               OPTION runs internally, and no external program is
               required.


           ##  Setting Individual Options

               If you follow the OPTION command with one or more
               sequences of a double slash mark [//] followed by an
               option=value setting, the OPTION dialogs or notebook
               will not appear.  Instead, the new settings will take
               effect immediately, and will be in effect for the
               current session only.  This example turns off batch
               file echo and changes the input colors to bright cyan
               on black (enter this all on one line):

                    c:\> option //BatchEcho = No //InputColors = bri
                    cya on bla

               Option values may contain whitespace.  However, you
               cannot enter an option value which contains the "//"
               string.

               This feature is most useful for testing settings
               quickly, and in aliases or batch files which depend
               on certain options being in effect.

               This use of OPTION is less efficient in 4DOS than it
               is in 4OS2 or 4NT, because 4DOS must load the
               external OPTION.EXE program for each OPTION //...
               command.  4OS2 and 4NT process // options internally.

               Changes made with // are temporary.  They will not be
               saved in the .INI file, even if you subsequently load
               the option dialogs and select Save.
  -331-

  PATH                                                      (Enhanced)

  Purpose:     Display or alter the list of directories that 4DOS,
               4OS2, or 4NT will search for executable files, batch
               files, and files with executable extensions that are
               not in the current directory.

  Format:      PATH [directory[;directory...]]

               directory:  The full name of a directory to include
               in the path setting.

               See also:  ESET and SET.

               Usage:    When the command processor is asked to
               execute an external command (a .COM, .EXE, .BTM,
               .BAT, or .CMD file or executable extension), it first
               looks for the file in the current directory.  If it
               fails to find an executable file there, it then
               searches each of the directories specified in the
               PATH setting.  See page 18 for more details on how
               the path is searched.  (Some applications also use
               the PATH to search for their data files.)

               For example, after the following PATH command, the
               command processor will search for an executable file
               in four directories:  the current directory, then the
               root directory on drive C, then the DOS subdirectory
               on C, and then the UTIL subdirectory on C:

                    c:\> path c:\;c:\dos;c:\util

               The list of directories to search can be set or
               viewed with the PATH command.  The list is stored as
               an environment string, and can also be set or viewed
               with SET, and edited with ESET.

               Directory names in the path must be separated by
               semicolons [;].  Each directory name is shifted to
               upper case to maintain compatibility with programs
               which can only recognize upper case directory names
               in the path.  If you modify your path with the SET or
               ESET command, you may include directory names in
               lower case.  These may cause trouble with some
               programs, which assume that all path entries have
               been shifted to upper case.

               On drives which support long filenames, some
               directory names may include spaces or other special
               characters.  Unlike other commands where quotes are
               required, such names should not be quoted in the
               PATH.

               If you enter PATH with no parameters, the current
               path is displayed:

                    c:\> path
  -332-

                    PATH=C:\;C:\DOS;C:\UTIL

               Entering PATH and a semicolon clears the search path
               so that only the current directory is searched for
               executable files (this is the default at system
               startup).

           ##  If you include an explicit file extension on a
               command name (for example, WP.EXE), the search will
               find files with that name and extension in the
               current directory and every directory in the path.
               It will not locate other files with the same base
               name (e.g., WP.COM).

           ##  If you have an entry in the path which consists of a
               single period [.], the current directory will not be
               searched first, but instead will be searched when the
               command processor reaches the "." in the path.  This
               allows you to delay the search of the current
               directory for executable files and files with
               executable extensions.  In rare cases, this feature
               may not be compatible with applications which use the
               path to find their files; if you experience a
               problem, you will have to remove the "." from the
               path while using any such application.

       4DOS ## In normal use, 4DOS can create a path as long as 250
               characters (the command-line limit is 255 characters,
               and "PATH " takes five).  However, some DOS
               applications expect a path no longer than the
               traditional limit of 123 characters.  If you extend
               your path beyond this limit and experience problems
               with applications, see the Compatibility section of
               the online help for tips on resolving the difficulty.

           ##  To create a path longer than the command-line length
               limit, use PATH repeatedly to append additional
               directories to the path:

                    path [first list of directories]
                    path %path;[second list of directories]
                    ...

               You cannot use this method to extend the path beyond
               506 characters in 4DOS or 2042 characters in 4OS2 and
               4NT (the internal buffer limits, with room for
               "PATH ").  It is usually more efficient to use
               aliases to load application programs than to create a
               long PATH.  See ALIAS on page 178 for details.

               If you specify an invalid directory in the path, it
               will be skipped and the search will continue with the
               next directory in the path.
  -333-

  PAUSE                                                     (Enhanced)

  Purpose:     Suspend batch file or alias execution.

  Format:      PAUSE [text]

               text:  The message to be displayed as a user prompt.

  Usage:       A PAUSE command will suspend execution of a batch
               file or alias, giving you the opportunity to change
               disks, turn on the printer, etc.

               PAUSE waits for any key to be pressed and then
               continues execution.  You can specify the text that
               PAUSE displays while it waits for a keystroke, or let
               it use the default message:

                    Press any key when ready...

               For example, the following batch file fragment
               prompts the user before erasing files (the PAUSE
               command should be entered on one line):

                    pause Press Ctrl-C to abort, any other key to
                      erase all .LST files
                    erase *.lst

               If you press Ctrl-C or Ctrl-Break while PAUSE is
               waiting for a key, execution of an alias will be
               terminated, and execution of a batch file will be
               suspended while you are asked whether to cancel the
               batch job (see page 93).  In a batch file you can
               handle Ctrl-C and Ctrl-Break yourself with the ON
               BREAK command (see page 327).
  -334-

  POPD                                                           (New)

  Purpose:     Return to the disk drive and directory at the top of
               the directory stack.

  Format:      POPD [*]

               See also:  DIRS, PUSHD, and Directory Navigation on
               page 51.

  Usage:       Each time you use the PUSHD command, it saves the
               current disk drive and directory on the internal
               directory stack.  POPD restores the last drive and
               directory that was saved with PUSHD and removes that
               entry from the stack.  You can use these commands
               together to change directories, perform some work,
               and return to the starting drive and directory.

               Directory changes made with POPD are recorded in the
               directory history list and can be displayed in the
               directory history window (see page 46).  Read the
               section on Directory Navigation beginning on page 51
               for complete details on this and other directory
               navigation features.

               This example saves and changes the current disk drive
               and directory with PUSHD, and then restores it.  The
               current directory is shown in the prompt:

                    c:\> pushd d:\database\test
                    d:\database\test> pushd c:\wordp\memos
                    c:\wordp\memos> pushd a:\123
                    a:\123> popd
                    c:\wordp\memos> popd
                    d:\database\test> popd
                    c:\>

               You can use the DIRS command to see the complete list
               of saved drives and directories (the directory
               stack).

               The POPD command followed by an asterisk [*] clears
               the directory stack without changing the current
               drive and directory.

           ##  If the directory on the top of the stack is not on
               the current drive, POPD will switch to the drive and
               directory on the top of the stack without changing
               the default directory on the current drive.
  -335-

  PROMPT                                                    (Enhanced)

  Purpose:     Change the command-line prompt.

  Format:      PROMPT [text]

               text:  Text to be used as the new command-line
               prompt.

  Usage:       You can change and customize the command-line prompt
               at any time.  The prompt can include normal text, and
               system information such as the current directory, the
               time and date, and the amount of memory available.
               You can create an informal "Hello, Bob!" prompt or an
               official-looking prompt full of impressive
               information.

               The prompt text can contain special commands in the
               form $?, where ? is one of the characters listed
               below:

                    b    The vertical bar character [|].

                    c    The open parenthesis [(].

                    d    Current date, in the format:  Fri  12-12-97
                         (formatted according to your current
                         country settings).

                    D    Current date, in the format:  Fri  Dec 12,
                         1997.

                    e    The ASCII ESC character (decimal 27).

                    f    The close parenthesis [)].

                    g    The > character.

                    h    Backspace over the previous character.

                    i    Display the OS/2 prompt header line, which
                         reminds you of how to return to the OS/2
                         desktop, or get help.

                    l    The < character.

                    m    Time in hours and minutes using 24-hour
                         format.

                    M    Time in hours and minutes using the default
                         country format and retaining "a" or "p",
                         e.g. 4:07p.

                    n    Current drive letter.

                    p    Current drive and directory (lower case).
  -336-

                    P    Current drive and directory (upper case on
                         drives which do not support long filenames;
                         directory names shown as stored on the disk
                         on HPFS, NTFS, and LFN drives).

                    q    The = character.

                    r    The numeric exit code of the last external
                         command.

                    s    The space character.

                    t    Current 24-hour time, in the format
                         hh:mm:ss.

                    T    Current 12-hour time, in the format
                         hh:mm:ss[a|p].

                    v    Operating system version number, in the
                         format 3.10.

                    xd:  Current directory on drive d:, in lower
                         case, including the drive letter.  (Uses
                         the actual case of the directory name as
                         stored on the disk for HPFS, NTFS, and LFN
                         drives; see page 14 for details.)

                    Xd:  Current directory on drive d:, in upper
                         case, including the drive letter.

                    z    Current shell nesting level; the primary
                         command processor is shell 0.

                    +    Display one + character for each directory
                         on the PUSHD directory stack.

                    $    The $ character.

                    _    CR/LF (go to beginning of a new line).

               For example, to set the prompt to the current date
               and time, with a ">" at the end:

                    c:\> prompt $D $t $g
                    Fri  Jun 6, 1997 10:29:19 >

               To set the prompt to the current date and time,
               followed by the current drive and directory in upper
               case on the next line, with a ">" at the end:

                    c:\> prompt $d $t$_$P$g
                    Fri  6-06-97 10:29:19
                    c:\>

               Under DOS, you can include the PROMPT command in your
               AUTOEXEC.BAT file to set the prompt whenever your
               system is rebooted.  The 4OS2 prompt can be set in
  -337-

               CONFIG.SYS (see below), and the prompt for any
               command processor can be set in 4START (see page 93),
               or in any batch file that runs when the command
               processor starts.

       4DOS    The default prompt is $n$g (drive name plus ">") on
               drives A and B, and $p$g (current drive and directory
               plus ">") on all other drives.  If you use 4DOS under
               OS/2, the SET PROMPT statement in the OS/2 CONFIG.SYS
               file (see next paragraph) may override the default
               4DOS prompt.  If it does, you will need to delete
               this statement if you want to use the default 4DOS
               prompt.

       4OS2    The 4OS2 default prompt is [$n] (drive name in square
               brackets) on floppy drives, and [$p] (current drive
               and directory in square brackets) on all other
               drives.  When OS/2 is installed, it inserts a SET
               PROMPT statement in CONFIG.SYS to set the prompt to
               $i[$p].  This prompt will override the 4OS2 defaults.
               The $i adds a header line to the default prompt to
               remind you of certain OS/2 keystrokes.  You must
               delete this statement if you want to use the default
               4OS2 prompt.

       4NT     The 4NT default prompt is [$n] (drive name in square
               brackets) on floppy drives, and [$p] (current drive
               and directory in square brackets) on all other
               drives.

               If you enter PROMPT with no arguments, the prompt
               will be reset to its default value.  The PROMPT
               command sets the environment variable PROMPT, so to
               view the current prompt setting use the command:

                    c:\> set prompt

               (If the prompt is not set at all, the PROMPT
               environment variable will not be used, in which case
               the SET command above will give a "Not in
               environment" error.)

           ##  Along with literal text, special characters, and ANSI
               sequences (under DOS and OS/2), you can include the
               text of any environment variable, internal variable,
               or variable function (see pages 110 and 119) in a
               prompt.  For example, if you want to include the
               amount of free memory in the command prompt, plus the
               current drive and directory, you could use this
               command:

                    c:\> prompt (%%@dosmem[K]K) $p$g
                    (601K) c:\data>

               Notice that the @DOSMEM function is shown with two
               leading percent signs [%].  If you used only one
               percent sign, @DOSMEM would be expanded once when the
  -338-

               PROMPT command was executed, instead of every time
               the prompt is displayed.  As a result, the amount of
               memory would never change from the value it had when
               you entered the PROMPT command.  You can also use
               back-quotes to delay expanding a variable or function
               until the prompt is displayed:

                    c:\> prompt `(%@dosmem[K]K) $p$g`

           ##  You can use this feature along with the @EXEC
               variable function (see page 126) to create a complex
               prompt which not only displays information but
               executes commands.  For example, to execute an alias
               which checks battery status each time the prompt is
               displayed (enter the alias on one line):

                    c:\> alias cbatt `if %_apmlife lt 30 beep 440 4
                    880 4 440 4 880 4`

                    c:\> prompt `%@exec[@cbatt]$p$g`

       4DOS,## If you have an ANSI-compatible driver installed under
       4OS2    4DOS, or are running 4OS2, you can include ANSI
               escape sequences in the PROMPT text.  See your online
               help for complete details on ANSI.  This example uses
               ANSI sequences to set a prompt that displays the
               shell level, date, time and path in color on the top
               line of the screen (enter the command as one line):

                    c:\> prompt $e[s$e[1;1f$e[41;1;37m$e[K[$z] $d
                         Time: $t$h$h$h  Path: $p$e[u$e[0;32m$n$g

       4NT     You cannot use ANSI escape sequences in your prompt
               in 4NT, because Windows NT does not provide ANSI
               support.

           ##  A few older batch files use the PROMPT command to
               transmit ANSI.SYS control sequences to the screen
               (for example, to redefine function keys).  This
               technique will not work with 4DOS and 4OS2, because
               they don't display a prompt within batch files;
               hence, the characters in the PROMPT string are never
               sent to ANSI.SYS.  To send ANSI sequences in 4DOS and
               4OS2, use the ECHO command, substituting an escape
               character followed by an e for $e in the PROMPT
               string (see page 83 for more information).

           ##  You may find it helpful to define a different prompt
               in secondary shells, perhaps including $z in the
               prompt to display the shell level.  To do so, place a
               PROMPT command in your 4START file and use IF or IFF
               statements to set the appropriate prompt for
               different shells (for an example, see page 119).
  -339-

  PUSHD                                                          (New)

  Purpose:     Save the current disk drive and directory, optionally
               changing to a new drive and directory.

  Format:      PUSHD [path]

               path:  The name of the new default drive and
               directory.

               See also:  DIRS, POPD, and Directory Navigation on
               page 51.

  Usage:       PUSHD saves the current drive and directory on a
               "last in, first out" directory stack.  The POPD
               command returns to the last drive and directory that
               was saved by PUSHD.  You can use these commands
               together to change directories, perform some work,
               and return to the starting drive and directory.  The
               DIRS command displays the contents of the directory
               stack.

               To save the current drive and directory, without
               changing directories, use the PUSHD command by
               itself, with no path.

               If a path is specified as part of the PUSHD command,
               the current drive and directory are saved and PUSHD
               changes to the specified drive and directory.  If the
               path includes a drive letter, PUSHD changes to the
               specified directory on the new drive without changing
               the current directory on the original drive.

               This example saves the current directory and changes
               to C:\WORDP\MEMOS, then returns to the original
               directory:

                    c:\> pushd \wordp\memos
                    c:\wordp\memos> popd
                    c:\>

               When you use PUSHD to change to a directory on an
               HPFS, NTFS, or LFN drive, you must quote the path
               name if it contains whitespace or special characters.
               See page 14 for additional details.

               PUSHD can also change to a network drive and
               directory specified with a UNC name (see page 12 for
               information on UNC names).

               If PUSHD cannot change to the directory you have
               specified it will attempt to search the CDPATH (see
               page 56) and the extended directory search database
               (see page 53).  You can also use wildcards in the
               path to force an extended directory search (see page
               55).  Read the section on Directory Navigation
  -340-

               beginning on page 51 for complete details on these
               and other directory navigation features.

               Directory changes made with PUSHD are also recorded
               in the directory history list and can be displayed in
               the directory history window (see page 46).

           ##  The directory stack can hold up to 511 characters, or
               between 20 and 40 typical entries (depending on the
               length of the names).  If you exceed this limit, the
               oldest entry is removed before adding a new entry.
  -341-

  QUIT                                                           (New)

  Purpose:     Terminate the current batch file.

  Format:      QUIT [value]

               value:  The numeric exit code to return to the
               command processor or to the previous batch file.

               See also:  CANCEL and EXIT.

  Usage:       QUIT provides a simple way to exit a batch file
               before reaching the end of the file.  If you QUIT a
               batch file called from another batch file, you will
               be returned to the previous file at the line
               following the original CALL.

               This example batch file fragment checks to see if the
               user entered "quit" and exits if true.

                    input  Enter your choice :  %%option
                    if  "%option" == "quit"  quit

               QUIT only ends the current batch file.  To end all
               batch file processing, use the CANCEL command.

           ##  If you specify a value, QUIT will set the ERRORLEVEL
               or exit code to that value.  For information on exit
               codes see the IF command, and the %? variable on page
               112.

           ##  You can also use QUIT to terminate an alias.  If you
               QUIT an alias while inside a batch file, QUIT will
               end both the alias and the batch file and return you
               to the command prompt or to the calling batch file.
  -342-

  RD / RMDIR                                                (Enhanced)

  Purpose:     Remove one or more subdirectories.

  Format:      RD [/S] path...
                    or
               RMDIR [/S] path...

               path:  The name of a subdirectory to remove.

       4NT     /S(ubdirectories)

               See also:  MD.

  File Selection:   Supports extended wildcards, ranges, multiple
               file names, and include lists (see pages 64 - 73).

  Usage:       RD and RMDIR are synonyms.  You can use either one.

               RD removes directories from the directory tree.  For
               example, to remove the subdirectory MEMOS from the
               directory WP:

                    c:\> rd \wp\memos

               Before using RD, you must delete all files and
               subdirectories (and their files) in the path you want
               to remove.  Remember to remove hidden and read-only
               files as well as normal files (you can use DEL /Z to
               delete hidden and read-only files).

               You can use wildcards in the path.  When removing a
               directory on an HPFS, NTFS, or LFN drive, you must
               quote any path which contains whitespace or special
               characters (see page 14 for details).

               If RD removes one or more directories, they will be
               deleted from the extended directory search database;
               see page 53 for details.

           ##  You cannot remove the root directory, the current
               directory (.), any directory above the current
               directory in the directory tree, or any directory in
               use by another process in a multitasking system.

  Options: !## /S(ubdirectories):  This option is included for
               compatibility with Windows NT's CMD.EXE, and must be
       4NT     used with extreme caution!  It deletes all files
               (including hidden and system files) in the named
               directory and all of its subdirectories, then removes
               all subdirectories.  It can erase all files on a
               drive with a single command.
  -343-

  REBOOT                                                         (New)

  Purpose:     Do a warm or cold system reboot.

  Format:      REBOOT [/C /L /S /V]

               /C(old reboot)           /S(hutdown)
               /L(ogoff)                /V(erify)

  ##  Usage:   REBOOT will log off or shut down the operating
               system, or completely restart your computer.  It
               normally performs a warm reboot, which is comparable
               to pressing Ctrl-Alt-Delete under DOS or OS/2, or to
               a shutdown and restart under Windows NT.

               Under DOS, REBOOT can also perform a cold reboot,
               which is comparable to turning the power off and back
               on or pressing the reset button.  A reboot is
               necessary to activate any changes to your CONFIG.SYS
               file in DOS and OS/2, and may also be used if you
               wish to restart DOS with an altered 4START or
               AUTOEXEC.BAT file.

               The following example prompts you to verify the
               reboot, then does a warm boot:

                    c:\> reboot /v

               REBOOT defaults to performing a warm boot, with no
               prompting.

               REBOOT flushes the disk buffers, resets the drives,
               and waits one second before rebooting, to allow disk
               caching programs to finish writing any cached data.
               4OS2 and 4NT issue commands to shut down the
               operating system before rebooting.

       4DOS  ! Under DOS, some system BIOSes, memory managers,
               multitaskers, or memory-resident programs (TSRs) may
               intercept attempts to reboot your system and defeat
               them entirely, convert a cold boot request to a warm
               boot or vice versa, or in very rare cases, hang the
               system -- requiring a reboot!  As a result you may
               need to experiment with which reboot options work
               best for your system hardware and software
               configuration, and under rare circumstances REBOOT
               may not be usable on your system.  REBOOT will not
               work properly from 4DOS while running under Windows
               95 (at most, it will shut down the 4DOS session, but
               not Windows 95 itself).

      4OS2 !## Under OS/2, REBOOT must use the DOS.SYS device driver
               to reboot your system.  DOS.SYS is loaded via a
               DEVICE= statement in your CONFIG.SYS file.  If
               DOS.SYS is not loaded, REBOOT will not work.
  -344-

  Options:     /C(old):  Do a "cold" reboot.  This is similar to
               turning the power off and back on, and may be
       4DOS    necessary to properly initialize the system.  REBOOT
               /C may not physically reset all hardware devices as
               thoroughly as actually turning off the power; its
               effect depends on the internal design of each
               hardware device and on your system configuration.
               This option will not work under Windows 95.

       4NT     /L(ogoff):  Log off Windows NT, but do not reboot.
               This option is equivalent to selecting Shutdown from
               the Start menu, then selecting "Close all programs
               and log on as a different user" in the shutdown
               dialog.

       4OS2,   /S(hutdown):  Shut down the system, but do not
       4NT     reboot.  In OS/2, this option is equivalent to
               clicking the "Shutdown" choice on the Workplace Shell
               popup menu.  In Windows NT, it is equivalent to
               selecting Shutdown from the Start menu, then
               selecting "Shut down the computer" in the shutdown
               dialog.

               /V(erify):  Prompt for confirmation (Y or N) before
               rebooting or taking the action specified by other
               REBOOT options.
  -345-

  REM                                                     (Compatible)

  Purpose:     Put a comment in a batch file.

  Format:      REM [comment]

               comment:  The text to include in the batch file.

  Usage:       The REM command lets you place a remark or comment in
               a batch file.  Batch file comments are useful for
               documenting the purpose of a batch file and the
               procedures you have used.  For example:

                    rem This batch file provides a
                    rem menu-based system for accessing
                    rem word processing utilities.
                    rem
                    rem Clear the screen and get selection
                    cls

               REM must be followed by a space or tab character and
               then your comment.  Comments can be up to 255
               characters long in 4DOS, or 1023 characters long in
               4OS2 and 4NT.  4DOS, 4OS2, and 4NT will normally
               ignore everything on the line after the REM command,
               including quote characters, redirection symbols, and
               other commands (see below for the exception to this
               rule).

               If ECHO is ON, the comment is displayed.  Otherwise,
               it is ignored.  If ECHO is ON and you don't want to
               display the line, preface the REM command with an at
               sign [@].

               You can also place a comment in a batch file by
               starting the comment line with two colons [::].  In
               essence this creates a batch file "label" without a
               valid label name.  Such comments are processed
               slightly faster than those entered with REM.

           ##  You can use REM to create a zero-byte file if you use
               a redirection symbol immediately after the REM
               command.  For example, to create the zero-byte file
               C:\FOO:

                    c:\> rem > foo

               (This capability is included for compatibility with
               COMMAND.COM and CMD.EXE.  A simpler method for
               creating a zero-byte file with 4DOS, 4OS2, or 4NT is
               to use  >filename as a command, with no actual
               command before the [>] redirection character.)
  -346-

  REN / RENAME                                              (Enhanced)

  Purpose:     Rename files or subdirectories.

  Format:      REN [/A:[[-]rhsda] /E /N /P /Q /S /T] old_name...
               new_name
                    or
               RENAME [/A:[[-]rhsda] /E /N /P /Q /S /T] old_name...
               new_name

               old_name:  Original name of the file(s) or
               subdirectory.
               new_name:  New name to use, or new path on the same
               drive.

               /A: (Attribute select)   /Q(uiet)
               /E (No error messages)   /S(ubdirectory)
               /N(othing)               /T(otal)
               /P(rompt)

                See also:  COPY and MOVE.

  File Selection:   Supports extended wildcards, ranges, multiple
               file names, and include lists (see pages 64 - 73).
               Use extended wildcards with caution on LFN volumes;
               see page 74 for details.

  Usage:       REN and RENAME are synonyms.  You may use either one.

               REN lets you change the name of a file or a
               subdirectory, or move one or more files to a new
               subdirectory on the same drive.  (If you want to move
               files to a different drive, use MOVE.)

               In its simplest form, you give REN the old_name of an
               existing file or subdirectory and then a new_name.
               The new_name must not already exist -- you can't give
               two files the same name (unless they are in different
               directories).  The first example renames the file
               MEMO.TXT to MEM.TXT.  The second example changes the
               name of the \WORD directory to \WP:

                    c:\> rename memo.txt mem.txt
                    c:\> rename \word \wp

               If you use REN to rename a directory, the extended
               directory search database will be automatically
               updated to reflect the change.  See page 53 for
               details.

               When you rename files on an HPFS, NTFS, or LFN drive,
               you must quote any file names which contain
               whitespace or special characters.  See page 14 for
               additional details.

               You can also use REN to rename a group of files that
               you specify with wildcards, as multiple files, or in
  -347-

               an include list.  When you do, the new_name must use
               one or more wildcards to show what part of each
               filename to change.  Both of the next two examples
               change the extensions of multiple files to .SAV:

                    c:\> ren config.sys autoexec.bat 4start.btm
                    *.sav
                    c:\> ren *.txt *.sav

               REN can move files to a different subdirectory on the
               same drive.  When it is used for this purpose, REN
               requires one or more filenames for the old_name and a
               directory name for the new_name:

                    c:\> ren memo.txt \wp\memos\
                    c:\> ren oct.dat nov.dat \data\save\

               The final backslash in the last two examples is
               optional.  If you use it, you force REN to recognize
               the last argument as the name of a directory, not a
               file.  The advantage of this approach is that if you
               accidentally mistype the directory name, REN will
               report an error instead of renaming your files in a
               way that you didn't intend.

               Finally, REN can move files to a new directory and
               change their name at the same time if you specify
               both a path and file name for new_name.  In this
               example, the files are renamed with an extension of
               .SAV as they are moved to a new directory:

                    c:\> ren *.dat \data\save\*.sav

               You cannot rename a subdirectory to a new location on
               the directory tree.

           ##  REN does not change a file's attributes.  The
               new_name file(s) will have the same attributes as
               old_name.

  Options: ##  /A:  (Attribute select): Rename only those files that
               have the specified attribute(s) set.  See Attribute
               Switches on page 174 for information on the
               attributes which can follow /A:.

               /E  (No error messages):  Suppress all non-fatal
               error messages, such as "File Not Found."  Fatal
               error messages, such as "Drive not ready," will still
               be displayed.  This option is most useful in batch
               files.

               /N(othing):  Do everything except actually rename the
               file(s).  This option is useful for testing what a
               REN command will actually do.
  -348-

               /P(rompt):  Prompt the user to confirm each rename
               operation.  Your options at the prompt are explained
               in detail on page 50.

               /Q(uiet):  Don't display filenames  or the number of
               files renamed.  This option is most often used in
               batch files.  See also /T.

               /S(ubdirectory):  Normally, you can rename a
               subdirectory only if you do not use any wildcards in
               the new_name.  This prevents subdirectories from
               being renamed inadvertently when a group of files is
               being renamed with wildcards.  /S will let you rename
               a subdirectory even when you use wildcards.  /S does
               not cause REN to process files in the current
               directory and all subdirectories as it does in some
               other file processing commands.  To rename files
               throughout a directory tree, use a GLOBAL REN (see
               page 275 for information on GLOBAL).

               /T(otal):  Don't display filenames as they are
               renamed, but report the number of files renamed.  See
               also /Q.
  -349-

  RETURN                                                         (New)

  Purpose:     Return from a GOSUB (subroutine) in a batch file.

  Format:      RETURN [value]

               value:  The numeric exit code to return to the
               command processor or to the previous batch file.

               See also:  GOSUB.

  Usage:       4DOS, 4OS2, and 4NT allow subroutines in batch files.

               A subroutine begins with a label (a colon followed by
               a word) and ends with a RETURN command.

               The subroutine is invoked with a GOSUB command from
               another part of the batch file.  When a RETURN
               command is encountered the subroutine terminates, and
               execution of the batch file continues on the line
               following the original GOSUB.  If RETURN is
               encountered without a GOSUB, the command processor
               will display a "Missing GOSUB" error.

               The following batch file fragment calls a subroutine
               which displays the files in the current directory:

                    echo Calling a subroutine
                    gosub subr1
                    echo Returned from the subroutine
                    quit

                    :subr1
                    dir /a/w
                    return

           ##  If you specify a value, RETURN will set the
               ERRORLEVEL or exit code to that value.  For
               information on exit codes see the IF command, and the
               %? variable on page 112.
  -350-

  SCREEN                                                         (New)

  Purpose:     Position the cursor on the screen and optionally
               display a message.

  Format:      SCREEN row column [text]

               row:  The new row location for the cursor.
               column:  The new column location for the cursor.
               text:  Optional text to display at the new cursor
               location.

               See also:  ECHO, SCRPUT, TEXT, and VSCRPUT.

  Usage:       SCREEN allows you to create attractive screen
               displays in batch files.  You use it to specify where
               a message will appear on the screen.  You can use
               SCREEN to create menus and other similar displays.
               The following batch file fragment displays a menu:

                    @echo off
                    cls
                    screen 3 10  Select a number from 1 to 4:
                    screen 6 20  1 - Word Processing
                    screen 7 20  2 - Spreadsheet
                    screen 8 20  3 - Telecommunications
                    screen 9 20  4 - Quit

               SCREEN does not change the screen colors.  To display
               text in specific colors, use SCRPUT or VSCRPUT.
               SCREEN always leaves the cursor at the end of the
               displayed text.

               The row and column values are zero-based, so on a 25
               line by 80 column display valid rows are 0 - 24 and
               valid columns are 0 - 79.  SCREEN checks for a valid
               row and column, and displays a "Usage" error message
               if either value is out of range.

               You can also specify the row and column as offsets
               from the current cursor position; to do so, begin the
               value with a plus sign [+] to move the cursor down or
               to the right, or with a minus sign [-] to move the
               cursor up or to the left.  This example prints a
               string 3 lines above the current position, in
               absolute column 10:

                    screen -3 10 Hello, World!

               If you specify 999 for the row, SCREEN will center
               the text vertically on the display.  If you specify
               999 for the column, SCREEN will center the text
               horizontally.
  -351-

  SCRPUT                                                         (New)

  Purpose:     Position text on the screen and display it in color.

  Format:      SCRPUT row col [BRIght] [BLInk] fg ON [BRIght] bg
               text

               row:  Starting row
               col:  Starting column
               fg:  Foreground character color
               bg:  Background character color
               text:  The text to display

               See also:  ECHO, SCREEN, TEXT, and VSCRPUT.

  Usage:       SCRPUT allows you to create attractive screen
               displays in batch files.  You use it to specify where
               a message will appear on the screen and what colors
               will be used to display the message text.  You can
               use SCRPUT to create menu displays, logos, etc.

               SCRPUT works like SCREEN, but requires you to specify
               the display colors.  See page 27 for details about
               colors and color names, and notes on the use of
               bright background colors.

               The row and column are zero-based, so on a standard
               25 line by 80 column display, valid rows are 0 - 24
               and valid columns are 0 - 79.  SCRPUT checks for a
               valid row and column, and displays a "Usage" error
               message if either value is out of range.

               You can also specify the row and column as offsets
               from the current cursor position.  Begin the value
               with a plus sign [+] to move down the specified
               number of rows or to the right the specified number
               of columns, or with a minus sign [-] to move up or to
               the left.

               If you specify 999 for the row, SCRPUT will center
               the text vertically on the display.  If you specify
               999 for the column, SCRPUT will center the text
               horizontally.

               SCRPUT normally does not move the cursor when it
               displays the text.  However, under 4DOS if you have
               set OutputBIOS to Yes in 4DOS.INI (see below), SCRPUT
               will leave the cursor at the end of the displayed
               text.

               The following batch file fragment displays a menu in
               color:

                    cls white on blue
                    scrput 3 10 bri whi on blu Select an option:
                    scrput 6 20 bri red on blu 1 - Word Processing
                    scrput 7 20 bri yel on blu 2 - Spreadsheet
  -352-

                    scrput 8 20 bri gre on blu 3 - Communications
                    scrput 9 20 bri mag on blu 4 - Quit

       4DOS ## If you have an unusual display adapter which does not
               support the direct video output used by SCRPUT, see
               the OutputBIOS directive on page 167.
  -353-

  SELECT                                                         (New)

  Purpose:     Interactively select files for a command.

  Format:      SELECT [/A[[:][-]rhsda] /C[HP] /D /E /H /I"text" /J
               /L /O[:][-]acdeginrsu /T:acw /Z] [command] ...
               (files...)...

               command:  The command to execute with the selected
               files.
               files:  The files from which to select.  File names
               may be enclosed in either parentheses or square
               brackets.  The difference is explained below.

               /A(ttribute select)      /J(ustify names)
               /C[HP] (Compression)     /L(ower case)
               /D(isable color coding)  /O(rder)
               /E (upper case)          /T(ime)
               /H(ide dots)             /X (display short names)
               /I (match descriptions)  /Z (use FAT format)

  File Selection:   Supports extended wildcards, ranges, multiple
               file names, and include lists (see pages 64 - 73).
               Ranges must appear immediately after the SELECT
               keyword.  Use extended wildcards with caution on LFN
               volumes; see page 74 for details.

  Usage:       SELECT allows you to select files for internal and
               external commands by using a full-screen "point and
               shoot" display.  You can have SELECT execute a
               command once for each file you select, or have it
               create a list of files for a command to work with.
               The command can be an internal command, an alias, an
               external command, or a batch file.

               If you use parentheses around the files, SELECT
               executes the command once for each file you have
               selected.  During each execution, one of the selected
               files is passed to the command as an argument.  If
               you use square brackets around files, the SELECTed
               files are combined into a single list, separated by
               spaces.  The command is then executed once with the
               entire list presented as part of its command-line
               arguments.


               Using the SELECT File List

               When you execute the SELECT command, the file list is
               displayed in a full-screen format which includes a
               top-line status bar and shows the command to be
               executed, the number of files marked, and the number
               of Kbytes in those files.

               SELECT uses the cursor up, cursor down, PgUp, and
               PgDn keys to scroll through the file list.  You can
               also use character matching to find specific files,
  -354-

               just as you can in any popup window; see page 32 for
               details.  While the file list is displayed you can
               enter any of the following keys to select or unselect
               files, display files, execute the command, or exit:

                    + or space  Select a file, or unselect a marked
                                file.

                    -           Unselect a marked file.

                    *           Reverse all of the current marks
                                (except those on subdirectories).
                                If no files have been marked you can
                                use * to mark all of the files.

                    /           Unselect all files.

                    Ctrl-L      View the current highlighted file
                                with LIST (see page 308).  When you
                                exit from LIST, the SELECT screen
                                will be restored.

                    Enter       Execute the command with the marked
                                files, or with the currently
                                highlighted file if no files have
                                been marked.

                    Esc         Skip the files in the current
                                display and go on to the next file
                                specification inside the parentheses
                                or brackets (if any).

                    Ctrl-C or   Cancel the current SELECT command
                      Ctrl-Breakentirely.

               On FAT drives the file list is shown in standard FAT
               directory format, with names at the left an
               descriptions at the right.  On HPFS, NTFS, and LFN
               drives the format is similar but more space is
               allowed for the name, and the description is not
               shown.  In this format long names are truncated if
               they do not fit in the allowable space.  For a
               traditional format (including descriptions) on long
               filename drives, use the /X and / or /Z switches.

               When displaying descriptions in the short filename
               format, SELECT adds a right arrow [a] at the end of
               the line if the description is too long to fit on the
               screen.  This symbol will alert you to the existence
               of additional description text.  You can use the left
               and right arrow keys to scroll the description area
               of the screen horizontally and view the additional
               text.

               You can display the filenames in color by using the
               SET command to create an environment variable called
               COLORDIR, or using the Commands page of the OPTION
  -355-

               dialogs or a text editor to set the ColorDir
               directive in your .INI file.  If you do not use the
               COLORDIR variable or the ColorDir directive, SELECT
               will use the default screen colors for all files.
               See the discussion of color-coded directories under
               DIR on page 230 for more details.  To disable
               directory color coding within SELECT, use the /D
               option.

               You can set the default colors used by SELECT on the
               Commands  page of the OPTION dialogs or with the
               SelectColors and SelectStatBarColors directives in
               the .INI file (see page 159).  If SelectColors is not
               used, the SELECT display will use the current default
               colors.  If SelectStatBarColors is not used, the
               status bar will use the reverse of the SELECT colors.


               Creating SELECT Commands

               In the simplest form of SELECT, you merely specify
               the command and then the list of files from which you
               will make your selection(s).  For example:

                    c:\> select copy (*.com *.exe) a:\

               will let you select from among the .COM files on the
               current drive, and will then invoke the COPY command
               to copy each file you select to drive A:.  After the
               .COM files are done, the operations will be repeated
               for the .EXE files.

               If you want to select from a list of all the .COM and
               .EXE files mixed together, create an include list
               inside the parentheses by inserting a semicolon (see
               page 73 for information on include lists):

                    c:\> select copy (*.com;*.exe) a:\

               Finally, if you want the SELECT command to send a
               single list of files to COPY, instead of invoking
               COPY once for each file you select, put the file
               names in square brackets instead of parentheses:

                    c:\> select copy [*.com;*.exe] a:\

               If you use brackets, you have to be sure that the
               resulting command (the word COPY, the list of files,
               and the destination drive in this example) does not
               exceed the command line length limit: 255 characters
               for internal commands or 126 characters for external
               commands under 4DOS; 1,023 characters for all
               commands under 4OS2 and 4NT.  The current line length
               is displayed by SELECT while you are marking files to
               help you to conform to these limits.
  -356-

               The parentheses or brackets enclosing the file
               name(s) can appear anywhere within the command;
               SELECT assumes that the first set of parentheses or
               brackets it finds is the one containing the list of
               files from which you wish to make your selection.

               When you use SELECT on an HPFS, NTFS, or LFN drive,
               you must quote any file names inside the parentheses
               which contain whitespace or special characters.  See
               page 14 for additional details.  For example, to copy
               selected files from the "Program Files" directory to
               the E:\SAVE directory:

                    c:\> select copy ("Program Files\*.*") e:\save\

               File names passed to the command will be quoted
               automatically if they contain whitespace or special
               characters.

               The list of files from which you wish to select can
               be further refined by using date, time, size, and
               file exclusion ranges (see page 67).  The range(s)
               must be placed immediately after the word SELECT.  If
               the command is an internal command that supports
               ranges, an independent range can also be used in the
               command itself.

               You cannot use command grouping to make SELECT
               execute several commands, because SELECT will assume
               that the parentheses are marking the list of files
               from which to select, and will display an error
               message or give incorrect results if you try to use
               parentheses for command grouping instead.  (However,
               you can use a SELECT command inside command grouping
               parentheses, you just can't use command grouping to
               specify a group of commands for SELECT to execute.)


           ##  Advanced Topics

               If you don't specify a command, the selected
               filename(s) will become the command.  For example,
               this command defines an alias called UTILS that
               selects from the executable files in the directory
               C:\UTIL, and then executes them in the order marked
               (enter the alias on one line):

                    c:\> alias utils select
                          (c:\util\*.com;*.exe;*.btm;*.bat)

               If you want to use filename completion (see page 41)
               to enter the filenames inside the parentheses, type a
               space after the opening parenthesis.  Otherwise, the
               command-line editor will treat the open parenthesis
               as the first character of the filename.
  -357-

               With the /I option, you can select files based on
               their descriptions.  SELECT will display files if
               their description matches the text after the /I
               switch.  The search is not case sensitive.  You can
               use wildcards and extended wildcards as part of the
               text.

               When sorting file names and extensions for the SELECT
               display, 4DOS, 4OS2, and 4NT normally assume that
               sequences of digits should be sorted numerically (for
               example, the file DRAW2 would come before DRAW03
               because 2 is numerically smaller than 03), rather
               than strictly alphabetically (where DRAW2 would come
               second because "2" comes after "0").  You can defeat
               this behavior and force a strict alphabetic sort with
               the /O:a option.

       4DOS    SELECT normally writes text directly to the screen.
               If you have an unusual display adapter which does not
               support direct video output, see the OutputBIOS
               directive on page 167.

      4DOS !   If you receive a stack overflow error when using
               SELECT in complex, nested command sequences, see the
               notes under the StackSize directive on page 167.

  Options: ##  /A(ttribute select):  Display only those files that
               have the specified attribute set.  See Attribute
               Switches on page 174 for information on the
               attributes which can follow /A.

       4DOS,   /C(ompression):  Display compression ratios on
       4NT     compressed drives.  The compression ratio is
               displayed instead of the file description.  The ratio
               is left blank for directories, for files with a
               length of 0 bytes, and for files on non-compressed
               drives.  The compression ratios will not be visible
               on LFN or NTFS drives unless you use /Z to switch to
               the traditional short filename format.

               Under 4DOS, only the compression programs distributed
               with MS-DOS and Windows 95 (DRVSPACE and DBLSPACE)
               are supported.  Under 4NT, only compressed NTFS
               drives are supported.

       4DOS    Using /CH displays compression ratios like /C, but
               bases the calculation on the host drive's cluster
               size.  This gives a more accurate picture of the
               space saved through compression.

       4DOS    If /CP is used instead of /C, the compression is
               displayed as a percentage instead of a ratio.  If
               /CHP is used instead of /CH, the host compression is
               displayed as a percentage.  The /CHP option must be
               entered as shown; you can not use /CPH.
  -358-

               See the DIR /C documentation on page 233 for more
               details on how compression ratios are calculated.

           ##  /D(isable color coding):  Temporarily turn off
               directory color coding.

               /E  (use upper case):  Display filenames in upper
               case; also see SETDOS /U (page 367) and the UpperCase
               directive in the .INI file (page 159).

               /H(ide dots):  Suppress the display of the "." and
               ".." directories.

               /I  (match descriptions):  Display filenames by
               matching text in their descriptions.  The text can
               include wildcards and extended wildcards.  The search
               text must be enclosed in quotation marks.  You can
               select all filenames that have a description with
               /I"[?]*", or all filenames that do not have a
               description with /I"[]".  /I will be ignored if /C or
               /O:c is also used.

               /J(ustify names):  Justify (align) filename
               extensions and display them in the traditional
               format.

               /L(ower case):  Display file and directory names in
               lower case; also see SETDOS /U (page 367) and the
               UpperCase directive in the .INI file (page 159).

               /O(rder):  Set the sort order for the files.  The
               order can be any combination of the following
               options:

                    -    Reverse the sort order for the next option.

                    a    Sort names and extensions in standard ASCII
                         order, rather than sorting numerically when
                         digits are included in the name or
                         extension.

       4DOS,        c    Sort by compression ratio (the least
       4NT               compressed file in the list will be
                         displayed first).  Under 4DOS, if /O:c is
                         used with /CH or /CHP, the sort will be
                         based on the host-drive compression ratios.
                         For information on supported compression
                         systems see /C above.

                    d    Sort by date and time (oldest first).

                    e    Sort by extension.

                    g    Group subdirectories together.

                    i    Sort by the file description (ignored if /C
                         or /O:c is also used).
  -359-

                    n    Sort by filename (this is the default).

                    r    Reverse the sort order for all options.

                    s    Sort by size.

                    u    Unsorted.

               /T:acw (Time display): Specify which of the date and
               time fields should be used on an LFN, NTFS, or HPFS
               drive:

                    a    Last access date and time (access time is
                         not saved on LFN volumes).

                    c    Creation date and time.

                    w    Last write date and time (default).

               See page 16 for more information on file dates and
               times on LFN, HPFS, and NTFS drives.

               /X (Display short names):  Display short filenames,
               in the traditional FAT format (like /Z), on NTFS and
               LFN drives.

               /Z:  Display a directory on an HPFS, NTFS, or LFN
               drive in the traditional FAT format, with the
               filename at the left and the description at the
               right.  Long names will be truncated to 12
               characters; if the name is longer than 12 characters,
               it will be followed by a right arrow [a].
  -360-

  SET                                                       (Enhanced)

  Purpose:     Display, create, modify, or delete environment
               variables.

  Format:      SET [/A /M /P /R file...] [name[=][value]]

               file:  One or more files containing variable
               definitions.
               name:  The name of the environment variable to define
               or modify.
               value:  The new value for the variable.

               /A(rithmetic)            /P(ause)
               /M(aster)                /R(ead from file)

               See also:  ESET and UNSET.

  Usage:       Every program and command inherits an environment,
               which is a list of variable names, each of which is
               followed by an equal sign and some text.  Many
               programs use entries in the environment to modify
               their own actions.  4DOS, 4OS2, and 4NT use several
               environment variables (see page 109).  See pages 21
               and 107 for more information on the environment.

               If you simply type the SET command with no options or
               arguments, it will display all the names and values
               currently stored in the environment.  Typically, you
               will see an entry called COMSPEC, an entry called
               PATH, an entry called CMDLINE, and whatever other
               environment variables you and your programs have
               established:

                    c:\> set
                    COMSPEC=C:\4DOS.COM
                    PATH=C:\;C:\DOS;C:\UTIL
                    CMDLINE=E:\UTIL\MAPMEM.EXE

               To add a variable to the environment, type SET, a
               space, the variable name, an equal sign, and the
               text:

                    c:\> set mine=c:\finance\myfiles

               The variable name is converted to upper case by 4DOS
               and 4OS2 (for compatibility with CMD.EXE, 4NT does
               not shift variable names to upper case).  The text
               after the equal sign will be left just as you entered
               it.  If the variable already exists, its value will
               be replaced with the new text that you entered.

           !   Normally you should not put a space on either side of
               the equal sign.  A space before the equal sign will
               become part of the name; a space after the equal sign
               will become part of the value.
  -361-

           !   If you use SET to create a variable with the same
               name as one of the 4DOS, 4OS2, or 4NT internal
               variables (see page 110), you will disable the
               internal variable.  If you later execute a batch file
               or alias that depends on that internal variable, it
               may not operate correctly.

               To display the contents of a single variable, type
               SET plus the variable name:

                    c:\> set mine

               You can edit environment variables with the ESET
               command.  To remove variables from the environment,
               use UNSET, or type SET plus a variable name and an
               equal sign:

                    c:\> set mine=

               The variable name is limited to a maximum of 80
               characters.  Under 4DOS, the name and value together
               cannot be longer than 255 characters.  In 4OS2 and
               4NT, the maximum length for the name and value
               together is 1,023 characters.

       4DOS ## Unless you use /M, SET only affects the environment
               of the current command processor and the programs it
               executes.  If you EXIT to a parent command processor,
               the original environment will be unchanged.

               In 4DOS, the size of the environment can be specified
               on the Startup page of the OPTION dialogs, with the
               Environment and EnvFree directives in 4DOS.INI (see
               page 149), or with the /E: startup switch (see your
               Introduction and Installation Guide).  In 4OS2 and
               4NT, the size of the environment is set
               automatically.

       4OS2 ## 4OS2 supports the "pseudo-variables" BeginLIBPath and
               EndLIBPath introduced in OS/2 Warp.  If you use
               either of these as a variable name, 4OS2 will pass
               the library path information from the SET command to
               the operating system, but the variables will not
               appear in the environment.  See your OS/2
               documentation for more information about these
               "variables".

  Options: ##  /A(rithmetic):  Evalute the argument to the right of
               the equal sign, place the result in the environment,
       4NT     and display it.  (You can use @EVAL to perform the
               same task; SET /A is included only for compatibility
               with Windows NT's CMD.EXE.)   For example, this
               command adds 2 and 2, and puts 4 in the variable VAR:

                    [c:\] set /a var=2+2
  -362-

               In addition, /A interprets alphabetic strings to the
               right of the equal sign as environment variable names
               even if they are not preceded by a percent sign.  For
               example, this sequence will set Y to 4:

                    [c:\] set x=2
                    [c:\] set /a y=x+2

       4DOS    /M(aster):  Display or modify the master environment
               rather than the local environment.  This option is
               only useful in secondary shells.

               /P(ause):  Wait for a key to be pressed after each
               screen page before continuing the display.  Your
               options at the prompt are explained in detail on page
               50.

           ##  /R(ead):  Read environment variables from a file.
               This is much faster than loading variables from a
               batch file with multiple SET commands.  Each entry in
               the file must fit within the command-line length
               limit for your command processor:  255 bytes for 4DOS
               and 1,023 bytes for 4OS2 and 4NT.  The file is in the
               same format as the SET display (i.e., name=value), so
               SET /R can accept as input a file generated by
               redirecting SET output.  For example, the following
               commands will save the environment variables to a
               file, and then reload them from that file:

                         set > varlist
                         set /r varlist

               You can load variables from multiple files by listing
               the filenames individually after the /R.  You can add
               comments to a variable file by starting the comment
               line with a colon [:].

               If you are creating a SET /R file and need to create
               an entry that spans multiple lines in the file, you
               can do so by terminating each line, except the last,
               with an escape character (see page 83).  However, you
               cannot use this method to exceed the command-line
               length limit.
  -363-

  SETDOS                                                         (New)

  Purpose:     Display or set the 4DOS, 4OS2, or 4NT configuration.

  Format:      SETDOS [/A? /B? /C? /D? /E? /Fn.n /G?? /I+|- command
                    /L? /M? /N? /P? /R? /S?:? /U? /V? /X[+|-]n /Y?]

               /A(NSI)                  /M(ode for editing)
               /B(right background)     /N(o clobber)
               /C(ompound)              /P(arameter character)
               /D(escriptions)          /R(ows)
               /E(scape character)      /S(hape of cursor)
               /F(ormat for @EVAL)      /U(pper case)
               /G (numeric separators)  /V(erbose)
               /I(nternal commands)     /X (expansion,special chars)
               /L(ine)                  /Y (debug batch file)

  Usage:       SETDOS allows you to customize certain aspects of
               4DOS, 4OS2, or 4NT to suit your personal tastes or
               the configuration of your system.  Each of these
               options is described below.

               You can display the value of all SETDOS options by
               entering the SETDOS command with no parameters.

               Most of the SETDOS options can be initialized when
               the command processor executes the directives in the
               .INI file (see page 153), and can also be set on the
               Command Line 1, Command Line 2, Options 1, or Options
               2 page of the OPTION dialogs.  The name of the
               corresponding directive is listed in square brackets
               [ ] with each option below; if none is listed, that
               option cannot be set with OPTION or from the .INI
               file.  You can also define the SETDOS options in your
               AUTOEXEC.BAT, 4START, or other startup file (see page
               93), in aliases, or at the command line.

               Secondary shells automatically inherit most
               configuration settings currently in effect in the
               previous shell.  If values have been changed by
               SETDOS since 4DOS, 4OS2, or 4NT started, the new
               values will be passed to the secondary shell.  For
               details on inheritance of SETDOS values by secondary
               shells and their relationship to the .INI file, see
               page 146.

               SETDOS /I settings are not inherited by secondary
               shells.  If you want to use SETDOS /I- to disable
               commands in all shells, place the SETDOS command(s)
               in your 4START file (see page 93), which is executed
               when any shell starts.

               Many of the options below are marked with ##.  If you
               are a new user, skip these and read the /M, /S, and
               /U options, which are more common.
  -364-

  Options: ##  /A(NSI)  [ANSI]:  This option determines whether 4DOS
               will attempt to use ANSI escape sequences for the CLS
       4DOS    and COLOR commands.  4DOS normally determines this
               itself, but if you are using a non-standard ANSI
               driver or your loading sequence is unusual, you may
               need to explicitly inform 4DOS.  /A0 allows 4DOS to
               determine automatically whether an ANSI driver is
               installed (the default).   /A1 forces 4DOS to assume
               an ANSI driver is installed.  /A2 forces 4DOS to
               assume an ANSI driver is not installed.  See page 25
               for more information on ANSI drivers.

       4OS2    The /A(NSI) option and the corresponding ANSI
               directive are not available in 4OS2.  ANSI support is
               automatically turned on by 4OS2, which assumes that
               it remains enabled.

       4NT     The /A(NSI) option and the corresponding ANSI
               directive are not available in 4NT because Windows NT
               does not provide ANSI support.

       4DOS,   /B(right background)  [BrightBG]:  This option
       4OS2    determines whether 4DOS and 4OS2 configure your video
               adapter for blinking text (/B0, the default) or
               bright background colors (/B1), or leave the video
               bright / blink configuration unchanged (/B2).  See
               page 27 for a detailed discussion of this option.

           ##  /C(ompound character)  [CommandSep]:  This option
               sets the character used for separating multiple
               commands on the same line.  The default is the caret
               [^] in 4DOS and the ampersand [&] in 4OS2 and 4NT.
               You cannot use any of the redirection characters (| >
               <), or the blank, tab, comma, or equal sign as the
               command separator.  The command separator is saved by
               SETLOCAL and restored by ENDLOCAL.  This example
               changes the separator to a tilde [~]:

                    c:\> setdos /c~

               If you want to share batch files or aliases among
               4DOS, 4OS2, 4NT, and Take Command, see page 113 for
               information on the %+ variable, which retrieves the
               current command separator, and page 136 for details
               on using compatible command separators for all the
               products you use.

           ##  /D(escriptions)  [Descriptions and DescriptionName]:
               This option controls whether file processing commands
               like COPY, DEL, MOVE, and REN process file
               descriptions along with the files they belong to.
               /D1 turns description processing on, which is the
               default.  /D0 turns description processing off.

               You can also use /D to set the name of the hidden
               file in each directory that contains file
  -365-

               descriptions.  To do so, follow /D with the filename
               in quotes:

                    c:\> setdos /d"files.bbs"

           !   Use this option with caution because changing the
               name of the description file will make it difficult
               to transfer file descriptions to another system.
               This option is provided for bulletin board system
               operators and others who have special needs.

           ##  /E(scape character)  [EscapeChar]:  This option sets
               the character used to suppress the normal meaning of
               the following character.  Any character following the
               escape character will be passed unmodified to the
               command.  The default escape character is Ctrl-X
               (ASCII 24, which appears on screen as an up-arrow) in
               4DOS and the caret [^] in 4OS2 and 4NT.  You cannot
               use any of the redirection characters (| > <) or the
               blank, tab, comma, or equal sign as the escape
               character.  The escape character is saved by SETLOCAL
               and restored by ENDLOCAL.  Certain characters (b, c,
               e, f, k, n, q, r, s, and t) have special meanings
               when immediately preceded by the escape character.
               See page 83 for additional details.

               If you want to share batch files or aliases among
               4DOS, 4OS2, 4NT, and Take Command, see page 113 for
               information on the %= variable, which retrieves the
               current escape character, and page 136 for details on
               using compatible escape characters for all the
               products you use.

               /F(ormat for @EVAL)  [EvalMax, EvalMin]:  This option
               lets you set default decimal precision for the @EVAL
               variable function (see page 125).  The maximum
               precision is 16 digits to the left of the decimal
               point and 8 digits to the right of the decimal point.

               The general form of this option is /Fx.y, where the x
               value sets the minimum number of digits to the right
               of the decimal place and the y value sets the maximum
               number of digits.  You can use =x,y instead of =x.y
               if the comma is your decimal separator.  Both values
               can range from 0 to 8; if x is greater than y, it is
               ignored.  You can specify either or both values:
               /F2.5, /F2, and /F.5 are all valid entries.  See the
               @EVAL function on page 125 if you want to set the
               precision for a single computation.

           ##  /I(nternal):  This option allows you to disable or
               enable internal commands.  To disable a command,
               precede the command name with a minus [-].  To re-
               enable a command, precede it with a plus [+].  For
               example, to disable the internal LIST command to
               force 4DOS to use an external command:
  -366-

                    c:\> setdos /i-list

           ##  /G  (Numeric separators) [DecimalChar,
               ThousandsChar]:  This option sets the decimal and
               thousands separator characters.  The format is /Gxy
               where "x" is the new decimal separator and "y" is the
               new thousands separator.  Both characters must be
               included.  The only valid settings are /G., (period
               is the decimal separator, comma is the thousands
               separator); /G,. (the reverse); or /G0 to remove any
               custom setting and use the default separators
               associated with your current country code (this is
               the default).

               The decimal separator is used for @EVAL, numeric IF
               and IFF tests, version numbers, and other similar
               uses.  The thousands separator is used for numeric
               output, and is skipped when performing calculations
               in @EVAL.

       4DOS,## /L(ine)  [LineInput]:  This option controls how 4DOS
       4OS2    or 4OS2 gets its input from the command line.  /L0
               tells the command processor to use character input
               (the default).  /L1 tells it to use line input (like
               COMMAND.COM and CMD.EXE).  /L1 will disable command-
               line editing, history recall, filename completion,
               and the directory history window, and will reduce the
               4OS2 input length limit from 1023 characters to 255
               characters.  It should only be used if it is needed
               for compatibility with a specific program.  If you
               have a program that requires line input, you can use
               the following line in an alias or batch file to
               change the line input option just for that single
               program (change the command separator to an ampersand
               [&] for 4OS2):

                    setdos /L1 ^ program %& ^ setdos /L0

               See the Compatibility section of the 4DOS online help
               for information on programs which require this
               option.

               /M(ode)  [EditMode]:  This option controls the
               initial line editing mode.  To start in overstrike
               mode at the beginning of each command line, use /M0
               (the default).  To start in insert mode, use /M1.

           ##  /N(o clobber)  [NoClobber]:  This option controls
               output redirection (see page 58).  /N0 means existing
               files will be overwritten by output redirection (with
               >) and that appending (with >>) does not require the
               file to exist already.  This is the default.  /N1
               means existing files may not be overwritten by output
               redirection, and that when appending the output file
               must exist.  A /N1 setting can be overridden with the
               [!] character.  If you use /N1, you may have problems
               with a few unusual programs that shell out to run a
  -367-

               command with redirection, and expect to be able to
               overwrite an existing file.

           ##  /P(arameter character)  [ParameterChar]:  This option
               sets the character used after a percent sign to
               specify all or all remaining command-line arguments
               in a batch file or alias (e.g., %& or %n&; see pages
               90 and 184).  The default is the ampersand [&] for
               4DOS and the dollar sign [$] for 4OS2 and 4NT.  The
               parameter character is saved by SETLOCAL and restored
               by ENDLOCAL.

               If you want to share batch files or aliases among
               4DOS, 4OS2, 4NT, and Take Command, see page 136 for
               details on selecting compatible parameter characters
               for all the products you use.

       4DOS,## /R(ows)  [ScreenRows]:  This option sets the number
       4OS2    of screen rows used by the video display.  Normally
               4DOS and 4OS2 detect the screen size, but if you have
               a non-standard display you may need to set it
               explicitly.  This option does not affect screen
               scrolling (that is controlled by your video driver
               or, under 4DOS, the BIOS or ANSI.SYS).  It also does
               not set the screen size; it is used only to specify
               the screen height for LIST, SELECT, paged output
               options (i.e., TYPE /P), and error checking in screen
               output commands.

               /S(hape)  [CursorOver, CursorIns]:  This option sets
               the cursor shape.  The format is /So:i where o is the
               cursor size for overstrike mode, i the cursor size
               for insert mode.  The size is entered as a percentage
               of the total character height.  The default values
               are 10:100 (a 10% underscore cursor for overstrike
               mode, and a 100% block cursor for insert mode).
               Because of the way video BIOSes and drivers remap the
               cursor shape, you may not get a smooth progression in
               the cursor size from 0% - 100%.  To disable the
               cursor, enter /S0:0.

               If either value is -1, , the command processor will
               not attempt to modify the cursor shape at all.  You
               can use this feature to give another program full
               control of the cursor shape.  You can retrieve the
               current cursor shape values with the %_CI and %_CO
               internal variables (see page 114).

               /U(pper)  [UpperCase]:  This option controls the
               default case (upper or lower) for file and directory
               names displayed by internal commands like COPY and
               DIR.  /U0 displays file names in lower case (the
               default).  /U1 displays file names in the traditional
               upper case.  The /U setting is ignored for filenames
               on LFN, HPFS, and NTFS drives.  Names on such drives
               are always displayed in the case in which they are
               stored; see page 14 for more details.
  -368-

           ##  /V(erbose)  [BatchEcho]:  This option controls the
               default for command echoing in batch files.  /V0
               disables echoing of batch file commands unless ECHO
               is explicitly set ON.  /V1, the default setting,
               enables echoing of batch file commands unless ECHO is
               explicitly set OFF.

               /V2 forces echoing of all batch file commands, even
               if ECHO is set OFF or the line begins with an "@".
               This allows you to turn echoing on for a batch file
               without editing the batch file and removing the ECHO
               OFF command(s) within it.  /V2 is intended for
               debugging, and can be set with SETDOS, but not with
               the OPTION command or the BatchEcho directive in the
               .INI file.  For more information on batch file
               debugging see page 97, and /Y (below).

           ##  /X[+|-]n  (expansion and special characters):  This
               option enables and disables alias and environment
               variable expansion, and controls whether special
               characters have their usual meaning or are treated as
               text.  It is most often used in batch files to
               process text strings which may contain special
               characters.  See page 100 for further details on
               string processing in batch files, and page 138 for
               details on alias expansion, variable expansion, and
               special characters.

               The features enabled or disabled by /X are numbered.
               All features are enabled when the command processor
               starts, and you can re-enable all features at any
               time by using /X0.  To disable a particular feature,
               use /X-n, where n is the feature number from the list
               below.  To re-enable the feature, use /X+n.  To
               enable or disable multiple individual features, list
               their numbers in sequence after the + or - (e.g. /X-
               345 to disable features 3, 4, and 5).

               The features are:

                    1    All alias expansion.

                    2    Nested alias expansion only.

                    3    All variable expansion (includes
                         environment variables, batch file
                         parameters, and alias parameters).

                    4    Nested variable expansion only.

                    5    Multiple commands, conditional commands,
                         and piping (affects the command separator,
                         ||, &&, |, and |&).

                    6    Redirection (affects < , >,  >&, >&>,
                         etc.).
  -369-

                    7    Quoting (affects back-quotes [`], double
                         quotes ["], and square brackets).

                    8    Escape character.

               If nested alias expansion is disabled, the first
               alias of a command is expanded but any aliases it
               invokes are not expanded.  If nested variable
               expansion is disabled, each variable is expanded
               once, but variables containing the names of other
               variables are not expanded further.

               For example, to disable all features except alias
               expansion while you are processing a text file
               containing special characters:

                    setdos /x-35678
                    ... [perform text processing here]
                    setdos /x0

           ##  /Y  (debug batch file):  /Y1 enables the built-in
               batch file debugger.  The debuggger allows you to
               "single-step" through a batch file line by line, with
               the file displayed in a popup window as it executes.
               For complete details on using the debugger see
               Debugging Batch Files on page 97 (this topic also
               covers additional debugging techniques which do not
               require stepping through each line individually).

               To start the debugger, insert a SETDOS /Y1 command at
               the beginning of the portion of the batch file you
               want to debug, and a SETDOS /Y0 command at the end.

               You cannot use the batch debugger with REXX files
               (see page 104) or EXTPROC files (page 106).  It can
               only be used with normal 4DOS, 4OS2, and 4NT batch
               files.

               You can also invoke SETDOS /Y1 from the prompt, but
               because the debugger is automatically turned off
               whenever the command processor returns to the prompt,
               you must enter the SETDOS command and the batch file
               name on the same line, for example:

                    c:\> setdos /y1 ^ mybatch.btm
  -370-

  SETLOCAL                                                       (New)

  Purpose:     Save a copy of the current disk drive, directory,
               environment, alias list, and special characters.

  Format:      SETLOCAL

               See also:  ENDLOCAL.

  Usage:       SETLOCAL is used in batch files to save the default
               disk drive and directory, the environment, the alias
               list, and the command separator, escape character,
               parameter character, decimal separator, and thousands
               separator.  You can then change their values and
               later restore the original values with ENDLOCAL.

               For example, this batch file fragment saves
               everything, removes all aliases so that user aliases
               will not affect batch file commands, changes the disk
               and directory, changes the command separator, runs a
               program, and then restores the original values:

                    setlocal
                    unalias *
                    cdd d:\test
                    setdos /c~
                    program ~ echo Done!
                    endlocal

               SETLOCAL and ENDLOCAL are not nestable within a batch
               file.  However, you can have multiple, separate
               SETLOCAL / ENDLOCAL pairs within a batch file, and
               nested batch files can each have their own SETLOCAL /
               ENDLOCAL.  You cannot use SETLOCAL in an alias or at
               the command line.

               An ENDLOCAL is performed automatically at the end of
               a batch file if you forget to do so.  If you invoke
               one batch file from another without using CALL, the
               first batch file is terminated, and an automatic
               ENDLOCAL is performed; the second batch file inherits
               the settings as they were prior to any SETLOCAL.

       4DOS !  Do not load memory-resident programs (TSRs) from a
               batch file while SETLOCAL is in effect.  If you do,
               when ENDLOCAL is executed and the memory used by
               SETLOCAL is released, a "hole" will be left in memory
               below the TSR.  This is not usually harmful, but
               wastes memory.
  -371-

  SHIFT                                                     (Enhanced)

  Purpose:     Allows the use of more than 127 batch file parameters
               in a batch file.

  Format:      SHIFT [n | /n]

               n:  Number of positions to shift.

  Usage:       SHIFT is provided for compatibility with older batch
               files, where it was used to access more than 10
               parameters.  4DOS, 4OS2, and 4NT support 128
               parameters (%0 to %127), so you probably will not
               need to use it for batch files running under JP
               Software products.

               SHIFT moves each of the batch file parameters n
               positions to the left.  The default value for n is 1.
               SHIFT 1 moves the parameter in %1 to position %0, the
               parameter in %2 becomes %1, etc.  You can reverse a
               SHIFT by giving a negative value for n.

               SHIFT also affects the parameters %n& (command-line
               tail; %n$ in 4OS2 and 4NT) and %# (number of command
               arguments).

               For example, create a batch file called TEST.BAT:

                    echo %1 %2 %3 %4
                    shift
                    echo %1 %2 %3 %4
                    shift 2
                    echo %1 %2 %3 %4
                    shift -1
                    echo %1 %2 %3 %4

               Executing TEST.BAT produces the following results:

                    c:\> test one two three four five six seven
                    one two three four
                    two three four five
                    four five six seven
                    three four five six

           ##  If you add a slash before the value n, the value
               determines the postion at which to begin the shift.
               For example:

                    shift /2

               leaves parameters %0 and %1 unchanged, and moves the
               value of %3 to postion %2, %4 to %3, etc.  The value
               after the slash cannot be negative, and shifts
               performed with the slash cannot be reversed.
  -372-

  SHRALIAS     [4OS2, 4NT]                                       (New)

  Purpose:     Retains global command history, directory history,
               and alias lists in memory when the command processor
               is not running.

  Format:      SHRALIAS [/U]

               /U(nload)

  Usage:       When you close all 4OS2 or 4NT sessions, the memory
               for the global command history, global directory
               history, and global alias list is released.  If you
               want the lists to be retained in memory even when no
               command processor session is running, you need to
               execute SHRALIAS.

               The SHRALIAS command starts and initializes
               SHRALIAS.EXE, a small program which remains active
               and retains global lists when 4OS2 or 4NT is not
               running.  In order to start the program, SHRALIAS
               must be able to find SHRALIAS.EXE either in the same
               directory as 4OS2 or 4NT, or in a directory in your
               PATH.  You cannot run SHRALIAS.EXE directly, it must
               be run by the SHRALIAS command.

               Once SHRALIAS has been executed, the global lists
               will be retained in memory until you use SHRALIAS /U
               to unload the lists, or until you shut down your
               operating system.

               SHRALIAS will not work unless you have at least one
               copy of 4OS2 or 4NT running with global alias,
               command history, and directory history lists enabled.
               If the required global lists are not found, SHRALIAS
               will display an error.

               If you start SHRALIAS from a temporary 4OS2 or 4NT
               session which exits after starting SHRALIAS (for
               example, by executing SHRALIAS in your OS/2
               STARTUP.CMD file), the command processor session may
               terminate and discard the shared lists before
               SHRALIAS can attach to them.  In this case
               SHRALIAS.EXE will not be loaded.  If you experience
               this problem, add a short delay with the DELAY
               command after SHRALIAS is loaded and before your
               session exits.

       4NT     SHRALIAS does not work properly in detached sessions
               (e.g. those started with DETACH, or with Windows NT's
               AT utility), due to security issues within Windows
               NT.  The SHRALIAS command will be ignored in detached
               sessions.

               For more information about global history and alias
               lists, see Local and Global Command History (page 40),
  -373-

               Local and Global Directory History (page 47), and
               local and global alias lists on page 185.

  Option:      /U(nload):  Shuts down SHRALIAS.EXE.  If SHRALIAS is
               not loaded again, the memory used by global command
               history, directory history, and alias lists will be
               released when the last copy of 4OS2 or 4NT exits.
  -374-

  START                                                     (Enhanced)

  Purpose:     Start a program in another session or window.

  Format:      The format for START depends on which command
               processor you are using (see the Options section
               below for additional minor differences in valid
               options under 4DOS and 4OS2):

       4DOS,   START ["program title"] [/B[G] /C /DOS[=optfile]
       4OS2    /F[G] /FS /I /ICON=iconfile /INV /K /L /LA /LD /LH
               /MAX /MIN /N/PGM progname /PM /POS=x,y,width,height
               /WAIT /WIN /WIN3[=optfile] /WIN3S[=optfile]]
               [command]

       4NT     START ["program title"] [/B /C /Dpath /HIGH /I
               /INV /K /L /LA /LD /LH /LOW /MAX /MIN /NORMAL
               /PGM progname /POS=x,y,width,height /REALTIME
               /SEPARATE /SHARED /SIZE=rows,columns /WAIT] [command]

               program title:  Title to appear on title bar.
               optfile:  Option settings file.
               iconfile:  Name of icon (.ICO) file.
               progname:  Program name (not the session name).
               path:  Startup directory.
               command:  Command to be executed.

               /B (no new console)        /LOW (priority)
               /B[G] (background session) /MAX(imized)
               /C(lose when done)         /MIN(imized)
               /D(irectory)               /N(o command processor)
               /DOS (DOS session)         /NORMAL (priority)
               /F[G](foreground session)  /PGM (program name)
               /FS (full screen)          /PM (PM application)
               /HIGH (priority)           /POS(ition of window)
               /I(nherit environment)     /REALTIME (priority)
               /ICON (name .ICO file)     /SEPARATE (virtual machine)
               /INV(isible)               /SHARED (WoW VDM)
               /K(eep when done)          /SIZE (of screen buffer)
               /L(ocal lists)             /WAIT (for session to finish)
               /LD (local directory history) /WIN(dowed session)
               /LA (local aliases)        /WIN3 (Windows enhanced mode)
               /LH  (local history list)  /WIN3S  (Windows standard mode)

               See also:  DETACH.

  Usage:       START is used to begin a new DOS, OS/2 or Windows NT
               session and, optionally, to run a program in that
               session.  If you use START with no parameters, it
               will begin a new session or window.  If you add a
               command, START will begin a new session or window and
               execute that command.
  -375-

               The program title, if it is included, will appear on
               the title bar, on the Presentation Manager window
               list (OS/2), or on the task list and Alt-Tab displays
               (Windows NT).  The program title must be enclosed in
               quotation marks and cannot exceed 60 characters in
               4OS2 and 4DOS, or 127 characters in 4NT.  If the
               program title is omitted, the program name will be
               used as the title.

               START always assumes that the first quoted string on
               the command line is the program title; if there is a
               second quoted string it is assumed to be the command.
               As a result, if the name of the program you are
               starting is a long filename containing whitespace
               (and must therefore be quoted), you cannot simply
               place it on the command line.  If you do, as the
               first quoted string it will be interpreted as the
               program title, not the command.  To address this, use
               the /PGM switch to indicate explicitly that the
               quoted string is the program name, or include a title
               before the program name.  For example, to start the
               program "C:\Program Files\Proc.Exe" you could use
               either of the first two commands below, but the third
               command would not work:

                    [c:\] start /PGM "C:\Program Files\Proc.Exe"
                    [c:\] start "test" "C:\Program Files\Proc.Exe"
                    [c:\] start "C:\Program Files\Proc.Exe"

               You can use START if you are running 4OS2, 4NT, or
               4DOS in an OS/2 DOS session.  START will not work
               when running 4DOS under DOS, under Windows, or under
               Windows 95.  (However, under Windows 95 you can use
               the external START command that is usually stored in
               your \WINDOWS\COMMAND folder.  See your Windows 95
               documentation or type START /? for details.)

               Although the START command has the same purpose in
               4DOS, 4OS2, and 4NT, there are several subtle
               differences between platforms.  The 4DOS and 4OS2
               versions of START are similar because both rely on
               the services of the OS/2 operating system.  The 4NT
               version of START has different options available in
               order to maintain compatibility with the START
               command in the Windows NT version of CMD.EXE, and
               also because it must work with the features of and
               limitations of Windows NT.

               START offers a large number of switches to control
               the session you start.  In most cases you need only a
               few switches to accomplish what you want.  The list
               below summarizes the most commonly used START
               options, and how you can use them to control the way
               a session is started:

                    /MAX,  /MIN, and /POS allow you to start a
                    character-mode windowed session in a maximized
  -376-

                    window, a minimized window, or a window with a
                    specified position and size.  The default is to
                    let the operating environment choose the
                    position and size of the window.

                    /C allows you to close the session when the
                    command is finished (the default for DOS, OS/2
                    Presentation Manager, and Windows NT graphical
                    sessions); /K allows you to keep the session
                    open and go to a prompt (the default for OS/2
                    and Windows NT character mode sessions).

       4OS2,        /BG and /FG allow you to start the session in
       4DOS         the background (does not respond to keystrokes
                    until selected) or foreground (responds to
                    keystrokes until deselected).  /FG is the
                    default if /DOS, /FS, /WIN, or /PM is used;
                    otherwise, /BG is the default.

       4OS2,        /FS and /WIN control whether a character-mode
       4DOS         session is started in full-screen or windowed
                    mode.  The default is to start a session of the
                    same type as the current session, if the
                    application can be run in such a session.

       4OS2,   Under 4OS2 and 4NT, START determines the application
       4NT     type automatically and starts the session in the
               appropriate mode.

               START gives you some flexibility in determining the
               session mode.  For example, if the command is the
               name of a batch file (either a .BTM or .CMD file),
               you can use the /FS or /WIN options under 4OS2 to run
               the batch file as part of a new session in either
               full-screen or windowed mode.

               However, you cannot start a session in a mode that is
               inappropriate for the application type.  A DOS
               application cannot be run as part of a Presentation
               Manager session, for example, even if you use the /PM
               switch.  Invalid or conflicting options will be
               ignored.  4OS2 and 4NT will always attempt to run the
               command in the appropriate type of session.

       4DOS    The 4DOS START command is unable to determine the
               application type.  If you don't specify the type on
               the command line, 4DOS will start a new OS/2 session
               to run it.

       4OS2 ## If the program is a DOS application or .BAT file,
               4OS2 will start a new DOS session to run it.  The DOS
               session will close itself automatically as soon as
               the program or batch file ends, unless /K is used.
               If you want the session to wait for a keystroke
               before it closes itself, you can use this syntax
               (assuming 4DOS is your command processor for OS/2 DOS
               sessions):
  -377-

                    [c:\] start /DOS command ^^ pause

               (Because the caret [^] is the default 4OS2 escape
               character, two carets must be used in order to pass
               one on to 4DOS as a command separator.)

       4OS2,   If you want to start a DOS command-line session in
       4DOS    OS/2, you can use the command:

                    [c:\] start /DOS

      4OS2,!## Under OS/2, you can specify settings for DOS and
      4DOS     Windows sessions by using a settings options file,
               and loading it with the /DOS=, /WIN3=, or /WIN3S=
               option.  This allows you to start DOS and Windows
               sessions with specific settings without creating a
               desktop object and modifying the settings manually.
               Before using this capability review the details below
               and in the online help carefully, since errors in the
               settings file can occasionally hang your system.

       4NT     If the progname is the name of a directory instead of
               an executable program, 4NT will start Windows
               Explorer in the specified directory if you are using
               Windows 95 or Windows NT 4.0 or later.  (Explorer
               must be in the PATH, the \WINDOWS directory, or the
               \WINDOWS\SYSTEM directory for this feature to work
               correctly.)

  Options:     Unlike most commands, the options below are not in
               strictly alphabetical order.  Instead, they are
               divided first by product, then alphabetically.

               The following options are available in 4OS2, 4NT, and
               4DOS:

                    /C(lose):  The session is closed when the
                    application ends.

                    /INV(isible):  Start the session or window as
                    invisible.  No icon will appear and the session
                    will only be accessible through the Task Manager
                    or Window List.

                    /K(eep session or window at end):  The session
                    or window continues after the application
                    program ends.  Use the EXIT command to end the
                    session.

                    /L(ocal lists):  Start the command processor
                    with local alias, history, and directory history
                    lists.  This option combines the effects of /LA,
                    /LD, and /LH (below).

                    /LA:  Start the command processor with a local
                    alias list.  See page 185 for information on
                    local and global aliases.
  -378-

                    /LD:  Start the command processor with a local
                    directory history list.  See page 47 for
                    information on local and global directory
                    history.

                    /LH:  Start the command processor with a local
                    history list.  See page 40 for information on
                    local and global history lists.

                    /MAX(imized):  Start the session or window
                    maximized.

                    /MIN(imized):  Start the session or window
                    minimized.

                    /PGM:  The string following this option is the
                    program name.  If you do not use /PGM, the first
                    quoted string on the line will be used as the
                    session title, and not as the program name.

                    /POS(ition):  Start the window at the specified
                    screen position.  The syntax is /POS=x,y,width,
                    height where the values are specified in pixels
                    or pels.  Under 4DOS and 4OS2, row and col refer
                    to the position of the bottom left corner of the
                    window relative to the bottom left corner of the
                    screen.  Under 4NT, row and col refer to the
                    position of the top left corner of the window
                    relative to the top left corner of the screen.

       4OS2,   The following options are available in 4OS2 and 4DOS,
       4DOS    but not in 4NT:

                    /BG:  The session is started as a background
                    session.  /BG may be abbreviated to /B.

                    /DOS[=filename]:  Start a DOS session under
                    OS/2.

                    If you include the =filename, OS/2 will load DOS
                    settings from the specified file.  You can also
                    alter the DOS settings for a session with
                    environment variables of the form
                    DosSetting.name=value, without using a settings
                    file.

                !   Starting a session with specific DOS settings is
                    an undocumented OS/2 feature and was implemented
                    within OS/2 with little error checking.  It is
                    included in START because it substantially eases
                    a complex task, but you must experiment
                    carefully to ensure that the settings you select
                    will work properly.  Incorrect settings may be
                    ignored, but they may also hang your session or
                    the entire system.  Full details are in the
                    online help; be sure to review the information
  -379-

                    there before you use /DOS=, or create any
                    DosSetting variables.

                    /FG:  Start the session as the foreground
                    session.  /FG may be abbreviated to /F.

                    /FS:  Start the session as a full-screen
                    session.

                    /ICON=filename:  Use the specified icon file.
                    If you don't use /ICON, the displayed icon will
                    be the one assigned by OS/2.

                    /N(o command processor):  Under 4OS2, start an
                    OS/2 program directly, without a command
                    processor.  The command cannot be an internal
                    command or batch file.  This is the default for
                    PM applications.  Under 4DOS, start a DOS
                    program directly.

                    /PM:  Start a program in the Presentation
                    Manager session.

                    /WIN(dowed):  Start the session in a window.

                    /WIN3[=filename]:  Run the program in an
                    enhanced-mode Windows 3.x session.  The session
                    will run seamless (on the OS/2 desktop) if
                    started from 4OS2, or full-screen if started
                    from 4DOS.  (To start a Windows application in
                    full-screen mode from 4OS2, use /FS).  You can
                    include an equal sign and the name of an options
                    file to set options for the session (see /DOS=
                    above and your online help for details).

                    /WIN3S[=filename]:  Equivalent to /WIN3, but
                    runs the program in standard mode rather than
                    enhanced mode.

       4OS2,   The following options are available in 4OS2 and 4NT,
       4NT     but cannot be used under 4DOS:

                    /I(nherit environment):  Inherit the system
                    default environment, if any, rather than the
                    current environment.

                    /WAIT:  Wait for the new session or window to
                    finish before continuing.  Cannot be used with
                    /WIN3 or /WIN3S.

       4NT     The final group of options is only available under
               4NT:

                    /B:  The program is started without creating a
                    new window or console, i.e. in the 4NT window.
                    Normally, the application is started in its own
  -380-

                    window.  For compatibility with CMD.EXE, /B also
                    disables Ctrl-C processing for the program.

                    /D(irectory):  Specifies the startup directory.
                    Include the directory immediately after the /D,
                    with no intervening spaces or punctuation.

                    /HIGH:  Start the window at high priority.

                    /LOW:  Start the window at low priority.

                    /NORMAL:  Start the window at normal priority.

                    /REALTIME:  Start the window at realtime
                    priority.

                    /SEPARATE:  Start a 16-bit Windows application
                    in a separate virtual machine.  Normally, all
                    16-bit Windows applications are started in the
                    same virtual machine.

                    /SHARED:  Start a 16-bit Windows application in
                    the shared virtual machine (the opposite of
                    /SEPARATE).  This is the default; the switch is
                    included only for compatibility with CMD.EXE.

                    /SIZE:  Start the window with the specified
                    screen buffer size.  The full syntax is
                    /SIZE=rows, columns, where rows is the number of
                    text rows and columns is the number of text
                    columns.
  -381-

  SWAPPING      [4DOS]                                           (New)

  Purpose:     Enable or disable 4DOS swapping, or display the
               swapping state.

  Format:      SWAPPING [ON | OFF]

  ##  Usage:   SWAPPING temporarily disables or enables the swapping
               of the transient portion of 4DOS to expanded memory,
               to XMS extended memory, or to disk (see page 151).

               Setting SWAPPING OFF may be useful for speeding up
               batch files (including AUTOEXEC.BAT) when 4DOS is
               using disk swapping.  When you are running several
               small programs from a batch file, disk swapping can
               sometimes cause a noticeable delay.  However, if you
               disable swapping, there will be about 200K less
               memory available for large application programs.

               The following batch file fragment disables swapping,
               runs several programs, and then re-enables swapping:

                    swapping off
                    c:\util\mouse
                    c:\video\ansi.com
                    cls bright white on blue
                    c:\bin\cache.com
                    swapping on

               If you enter SWAPPING with no arguments, 4DOS
               displays the current swapping type (XMS, EMS, Disk,
               or None) and state:

                    c:\> swapping
                    SWAPPING (XMS) is ON

               Setting SWAPPING OFF does not close the disk swap
               file or release any reserved EMS or XMS memory.

               You may have trouble if you load memory-resident
               programs (TSRs) with SWAPPING OFF and unload them
               with SWAPPING ON, or vice versa.  Many TSRs expect
               the system to be in the same state when they unload
               that it was in when they loaded, and variation from
               this norm may cause the TSR to unload improperly or
               hang your system.
  -382-

  SWITCH                                                         (New)

  Purpose:     Select commands to execute based on a value.

  Format:      SWITCH expression
               CASE value1 [.OR. value2] ...
                    commands
               CASE value3
                    commands
               [DEFAULT
                    commands]
               ENDSWITCH

               expression:  An environment variable, internal
               variable, variable function, text string, or a
               combination of these elements, that is used to select
               a group of commands.
               value1, value2, etc.:  A value to test, or multiple
               values connected with .OR.
               commands:  One or more commands to execute if the
               expression matches the value.  If you use multiple
               commands, they must be separated by command
               separators or placed on separate lines.

               See also:  IF and IFF.

  Usage:       SWITCH can only be used in batch files.  It allows
               you to select a command or group of commands to
               execute based on the possible values of a variable or
               a combination of variables and text.

               The SWITCH command is always followed by an
               expression created from environment variables,
               internal variables, variable functions, and text
               strings, and then by a sequence of CASE statements
               matching the possible values of the expression.  If
               one of the values in a CASE statement matches the
               expression, the commands following that CASE
               statement are executed, and all subsequent CASE
               statements and the commands which follow them are
               ignored.  If no matches are found, the commands
               following the optional DEFAULT statement are
               executed.  If there are no matches and there is no
               DEFAULT statement, no commands are executed by
               SWITCH.

               After all of the commands following the CASE or
               DEFAULT statement are executed, the batch file
               continues with the commands that follow ENDSWITCH.

               You must include a command separator or new line
               after the expression, before each CASE or DEFAULT
               statement, before each command, and before ENDSWITCH.
               You can link values in a CASE statement with .OR.
               (but not with .AND. or .XOR.).
  -383-

               For example, the following batch file fragment
               displays one message if the user presses A, another
               if user presses B or C, and a third if the user
               presses any other key:

                    inkey Enter a keystroke: %%key
                    switch %key
                    case A
                       echo It's an A
                    case B .or. C
                       echo It's either B or C
                    default
                       echo It's not A, B, or C
                    endswitch

               In the example above, the value of a single
               environment variable was used for the expression.
               You will probably find that this is the best method
               to use in most situations.  However, you can use
               other kinds of expressions if necessary.  The first
               example below selects a command to execute based on
               the length of a variable, and the second bases the
               action on a quoted text string stored in an
               environment variable:

                    switch %@len[%var1]
                    case 0
                       echo Missing var1
                    case 1
                       echo Single character
                    ...
                    endswitch

                    switch "%string1"
                    case "This is a test"
                       echo Test string
                    case "The quick brown fox"
                       echo It's the fox
                    ...
                    endswitch

               The SWITCH and ENDSWITCH commands must be on separate
               lines, and cannot be placed within a command group
               (see page 81), or on the same line as other commands
               (this is the reason SWITCH cannot be used in
               aliases).  However, commands within the SWITCH block
               can use command groups or the command separator in
               the normal way.

               SWITCH commands can be nested.  Under 4DOS, the
               permissible nesting level depends on the amount of
               free space in 4DOS's internal stack; if you receive a
               stack overflow error when using SWITCH in complex,
               nested command sequences, see the notes under the
               StackSize directive on page 167.
  -384-

               You can exit from all SWITCH / ENDSWITCH processing
               by using GOTO to a line past the last ENDSWITCH.
  -385-

  TEE                                                            (New)

  Purpose:     Copy standard input to both standard output and a
               file.

  Format:      TEE [/A] file...

               file:  One or more files that will receive the "tee-
               d" output.

               /A(ppend)

               See also:  Y, and the redirection options (page 58).

  ##  Usage:   TEE is normally used to "split" the output of a
               program so that you can see it on the display and
               also save it in a file.  It can also be used to
               capture intermediate output before the data is
               altered by another program or command.

               TEE gets its input from standard input (usually the
               piped output of another command or program), and
               sends out two copies:  one goes to standard output,
               the other to the file or files that you specify.  TEE
               is not likely to be useful with programs which do not
               use standard output, because these programs cannot
               send output through a pipe.  See page 61 for more
               information on pipes.

               For example, to search the file DOC for any lines
               containing the string "4DOS", make a copy of the
               matching lines in 4.DAT, sort the lines, and write
               them to the output file 4D.DAT:

                    c:\> find "4DOS" doc | tee 4.dat | sort > 4d.dat

               If you are typing at the keyboard to produce the
               input for TEE, you must enter a Ctrl-Z to terminate
               the input.

       4DOS    When using TEE with a pipe under 4DOS, the previous
               command writes its output to a temporary file.  When
               that command finishes, TEE begins operation and can
               read the temporary file, display the output, and
               write it to the file(s) named in the TEE command.

       4OS2,   When using TEE with a pipe under 4OS2 or 4NT, the
       4NT     programs on the two ends of the pipe run
               simultaneously, not sequentially as in 4DOS.  See
               page 62 for more information.

  Option:      /A(ppend):  Append the output to the file(s) rather
               than overwriting them.
  -386-

  TEXT                                                           (New)

  Purpose:     Display a block of text in a batch file.

  Format:      TEXT
                    .
                    .
                    .
               ENDTEXT

               See also:  ECHO, SCREEN, SCRPUT, and VSCRPUT.

  Usage:       TEXT can only be used in batch files.

               The TEXT command is useful for displaying menus or
               multi-line messages.  TEXT will display all
               subsequent lines in the batch file until terminated
               by ENDTEXT.  Both TEXT and ENDTEXT must be entered as
               the only command on the line.

               To redirect the entire block of text, use redirection
               on the TEXT command itself, but not on the actual
               text lines or the ENDTEXT line.  No environment
               variable expansion or other processing is performed
               on the lines between TEXT and ENDTEXT; they are
               displayed exactly as they are stored in the batch
               file.

       4DOS,   If you are running 4OS2, or 4DOS with an ANSI driver
       4OS2    loaded, you can change screen colors by inserting
               ANSI escape sequences anywhere in the text block.
               This will not work in 4NT, because Windows NT does
               not provide ANSI support.  You can also use a CLS or
               COLOR command in 4DOS, 4OS2, or 4NT to set the screen
               color before executing the TEXT command.

               The following batch file fragment displays a simple
               menu:

                    @echo off
                    cls
                    screen 2 0
                    text
                    Enter one of the following:
                    1 - Spreadsheet
                    2 - Word Processing
                    3 - DOS Utilities
                    4 - Exit
                    endtext
                    inkey /k"1234" Enter your selection:  %%key
  -387-

  TIME                                                    (Compatible)

  Purpose:     Display or set the current system time.

  Format:      TIME [/T] [hh[:mm[:ss]]] [AM | PM]

               hh:  The hour (0 - 23).
               mm:  The minute (0 - 59).
               ss:  The second (0 - 59).

               /T (Display only)

               See also: DATE

  Usage:       If you don't enter any parameters, TIME will display
               the current system time and prompt you for a new
               time.  Press Enter if you don't wish to change the
               time; otherwise, enter the new time:

                    c:\> time
                    Mon  Dec 22, 1997  9:30:06
                    New time (hh:mm:ss):

               TIME defaults to 24-hour format, but you can
               optionally enter the time in 12-hour format by
               appending "a", "am", "p", or "pm" to the time you
               enter.

               For example, to enter the time as 9:30 am:

                    c:\> time 9:30 am

               The operating system adds the system time and date to
               the directory entry for every file you create or
               modify.  If you keep both the time and date accurate,
               you will have a record of when you last updated each
               file.

  Option:      /T:  Displays the current time but does not prompt
       4NT     you for a new time.  You cannot specify a new time on
               the command line with /T.  If you do, the new time
               will be ignored.
  -388-

  TIMER                                                          (New)

  Purpose:     TIMER is a system stopwatch.

  Format:      TIMER [ON] [/1 /2 /3 /S]

               ON:  Force the stopwatch to restart

               /1 (stopwatch #1)        /3 (stopwatch #3)
               /2 (stopwatch #2)        /S(plit)

  Usage:       The TIMER command turns a system stopwatch on and
               off.  When you first run TIMER, the stopwatch starts:

                    c:\> timer
                    Timer 1 on:  12:21:46

               When you run TIMER again, the stopwatch stops and the
               elapsed time is displayed:

                    c:\> timer
                    Timer 1 off:  12:21:58   Elapsed time:
                    0:00:12.06

               There are three stopwatches available (1, 2, and 3)
               so you can time multiple overlapping events.  By
               default, TIMER uses stopwatch #1.

               TIMER is particularly useful for timing events in
               batch files.  For example, to time both an entire
               batch file, and an intermediate section of the same
               file, you could use commands like this:

                    rem Turn on timer 1
                    timer
                    rem Do some work here
                    rem Turn timer 2 on to time the next section
                    timer /2
                    rem Do some more work
                    echo Intermediate section completed
                    rem Display time taken in intermediate section
                    timer /2
                    rem Do some more work
                    rem Now display the total time
                    timer

               The smallest interval TIMER can measure depends on
               the operating system you are using, your hardware,
               and the interaction between the two.  However, it
               should never be greater than .06 second.  The largest
               interval is 23 hours, 59 minutes, 59.99 seconds.

  Options:     /1:  Use timer #1 (the default).

               /2:  Use timer #2.

               /3:  Use timer #3.
  -389-

               /S(plit):  Display a split time without stopping the
               timer.  To display the current elapsed time but leave
               the timer running:

                    c:\> timer /s
                    Timer 1 elapsed: 0:06:40.63

               ON:  Start the timer regardless of its previous state
               (on or off).  Otherwise the TIMER command toggles the
               timer state (unless /S is used).
  -390-

  TITLE      [4OS2, 4NT]                                  (Compatible)

  Purpose:     Change the window title.

  Format:      TITLE title

               title:  The new window title

               See also:  ACTIVATE and WINDOW.

  Usage:       TITLE changes the text that appears in the caption
               bar at the top of the 4NT or 4OS2 window.  You can
               also change a 4NT window title with the WINDOW
               command or the ACTIVATE command.

               The title text should not be enclosed in quotes
               unless you want the quotes to appear as part of the
               actual title.

               To change the title of the current window to
               "Enhanced Command Prompt for Windows NT":

                    [c:\] title Enhanced Command Prompt for Windows
                    NT
  -391-

  TOUCH                                                          (New)

  Purpose:     Change a file's date and time stamps.

  Format:      TOUCH [/C /D[acw][mm-dd-yy] /E /F /Q /T[acw][hh:mm]
               file...

               file:  One or more files whose date and/or time
               stamps are to be changed.

               /C(reate file)           /F(orce read-only files)
               /D(ate)                  /Q(uiet)
               /E (No error messages)   /T(ime)

  File Selection:   Supports extended wildcards, ranges, multiple
               file names, and include lists (see pages 64 - 73).
               Use extended wildcards with caution on LFN volumes;
               see page 74 for details.

  Usage:       TOUCH is used to change the date and / or time of a
               file.  You can use it to be sure that particular
               files are included or excluded from an internal
               command, backup program, compiler MAKE utility, or
               other program that selects files based on their time
               and date stamps, or to set a group of files to the
               same date and time for consistency.

           !   TOUCH should be used with caution, and in most cases
               should only be used on files you create.  Many
               programs depend on file dates and times to perform
               their work properly.  In addition, many software
               manufacturers use file dates and times to signify
               version numbers.  Indiscriminate changes to date and
               time stamps can lead to confusion or incorrect
               behavior of other software.

               TOUCH normally works with existing files, and will
               display an error if the file you specify does not
               exist, or has the read-only attribute set.  To create
               the file if it does not already exist, use the /C
               switch.  To force a date and time change for read-
               only files, use the /F switch.

               TOUCH displays the date, time, and full name of each
               file whose timestamp is modified.  To disable this
               output, use /Q.

               If you don't specify a date or a time, TOUCH will
               default to the current date and time.  For example,
               to set the time stamp of all .C files in the current
               directory to the current date and time:

                    d:\source> touch *.c
                     6-12-97 11:13:58  D:\SOURCE\MAIN.C
                     6-12-97 11:13:58  D:\SOURCE\INIT.C
                     ...
  -392-

               If you specify a date but not a time, the time will
               default to the current time from your system clock.
               Similarly, if you specify a time but not a date, the
               date will be obtained from the system clock.

               On LFN, HPFS, and NTFS files, TOUCH sets the
               "modified" or "last write" date and time by default.
               By adding an a, c, or w to the /D or /T switch, you
               can set the last access, creation, or last write date
               and time stamps that are maintained for each file;
               see page 16 and the Options section below for
               additional details.

  Options:     /C(reate file):  Create the file (as a zero-byte
               file) if it does not already exist.  You cannot use
               wildcards with /C, but you can create multiple files
               by listing them individually on the command line.

               /D(ate):  Specify the date that will be set for the
               selected files.  If the date is not specified, TOUCH
               will use the current date.  For LFN, HPFS, and NTFS
               files you can use /Da, /Dc, or /Dw, followed by the
               date, to explicitly specify the last access,
               creation, or last write date stamp.  The date must be
               entered using the proper format for your current
               country settings.

           ##  /E  (No error messages):  Suppress all non-fatal
               error messages, such as "File not found."  Fatal
               error messages, such as "Drive not ready," will still
               be displayed.  This option is most useful in batch
               files.

               /F(orce read-only files):  Remove the read-only
               attribute from each file before changing the date and
               time, and restore it afterwards.  Without /F,
               attempting to change the date and time on a read-only
               file will usually cause an error.

               /Q(uiet):  Do not display the new date and time for
               each file.

               /T(ime):  Specify the time that will be set for the
               selected files, in hh:mm format.  If the time is not
               specified, TOUCH will use the current time.  For LFN,
               HPFS, and NTFS files you can use /Ta, /Tc, or /Tw,
               followed by the time, to explicitly specify the last
               access, creation, or last write time stamp.  However,
               files on LFN volumes do not have a last access time,
               so /Ta will have no effect.
  -393-

  TREE                                                           (New)

  Purpose:     Display a graphical directory tree.

  Format:      TREE [/A /B /F /H /P /S /T[:acw]] dir...

               dir:  The directory to use as the start of the tree.
               If more than one directory is specified, TREE will
               display a directory tree for each.

               /A(SCII)                 /P(ause)
               /B(are)                  /S (file size)
               /F(iles)                 /T(ime and date)
               /H(idden directories)

  File Selection:   Supports extended wildcards, ranges, multiple
               directory names, and include lists (see pages 64 -
               73).

  Usage:       The TREE command displays a graphical representation
               of the directory tree using standard or extended
               ASCII characters.  For example, to display the
               directory structure on drive C:

                    c:\> tree c:\

               You can print the display, save it in a file, or view
               it with LIST by using standard redirection symbols
               (see page 58).  Be sure to review the /A option
               before attempting to print the TREE output.  The
               options, discussed below, specify the amount of
               information included in the display.

  Options:     /A(SCII):  Display the tree using standard ASCII
               characters.  You can use this option if you want to
               save the directory tree in a file for further
               processing or print the tree on a printer which does
               not support the graphical symbols that TREE normally
               uses.

               /B(are):  Display the full pathname of each
               directory, without any of the line-drawing
               characters.

               /F(iles):  Display files as well as directories.  If
               you use this option, the name of each file is
               displayed beneath the name of the directory in which
               it resides.

               /H(idden):  Display hidden as well as normal
               directories.  If you combine /H and /F, hidden files
               are also displayed.

               /P(ause):  Wait for a key to be pressed after each
               screen page before continuing the display.  Your
               options at the prompt are explained in detail on page
               50.
  -394-

               /S(ize):  Display the size of each file.  This option
               is only useful when combined with /F.

               /T(ime and date):  Display the time and date for each
               directory.  If you combine /T and /F, the time and
               date for each file will also be displayed.  For LFN,
               HPFS, and NTFS files, the time and date of the last
               write will be shown by default.  You can select a
               specific time and date stamp by using the following
               variations of /T (see page 16 for more details on
               date and time stamps):

                    /T:a Last access date and time (access time is
                         not saved on LFN volumes).

                    /T:c Creation date and time.

                    /T:w Last write date and time (default).
  -395-

  TRUENAME      [4DOS, 4NT]                                      (New)

  Purpose:     Find the full, true path and file name for a file.

  Format:      TRUENAME file

               file:  The file whose name TRUENAME will report.

               See also:  @TRUENAME variable function on page 134.

  Usage:       Default directories, as well as the JOIN and SUBST
               external commands, can obscure the true name of a
               file.  TRUENAME "sees through" these obstacles and
               reports the fully qualified name of a file.

               The following example 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

       4DOS    To use TRUENAME under 4DOS you must be running MS-DOS
               or PC-DOS 3.0 or above, Novell DOS / OpenDOS 6.0 or
               above, Windows 95, or OS/2 version 2.0 or above.

               On LFN drives TRUENAME returns the short name for the
               file, for example:

                    c:\> truename "Program Files"
                    C:\PROGRA~1

               TRUENAME can handle simple drive substitutions such
               as those created by JOIN, SUBST, or most network
               drive mappings.  However, it may not be able to
               correctly determine the true name if you use "nested"
               JOIN or SUBST commands, or a network which does not
               report true names properly.
  -396-

  TYPE                                                      (Enhanced)

  Purpose:     Display the contents of the specified file(s).

  Format:      TYPE [/A:[[-]rhsda] /L /P] file...

               file:  The file or list of files that you want to
               display.

               /A: (Attribute select)   /P(ause)
               /L(ine numbers)

               See also:  LIST.

  File Selection:   Supports extended wildcards, ranges, multiple
               file names, and include lists (see pages 64 - 73).

  Usage:       The TYPE command displays a file.  It is normally
               only useful for displaying ASCII text files.
               Executable files (.COM and .EXE) and many data files
               may be unreadable when displayed with TYPE because
               they include non-alphanumeric characters.

               To display the files MEMO1 and MEMO2:

                    c:\> type /p memo1 memo2

               To display text from the clipboard use CLIP: as the
               file name.  CLIP: will not return any data if the
               clipboard does not contain text.  See page 58 for
               additional information on CLIP:.

               You will probably find LIST to be more useful for
               displaying files.  However, the TYPE /L command used
               with redirection (see page 58) is useful if you want
               to add line numbers to a file, for example:

                    c:\> type /l myfile > myfile.num

  Options:  ## /A:  (Attribute select): Select only those files that
               have the specified attribute(s) set.  See Attribute
               Switches on page 174 for information on the
               attributes which can follow /A:.

               /L(ine numbers):  Display a line number preceding
               each line of text.

               /P(ause):  Prompt after displaying each page.  Your
               options at the prompt are explained in detail on page
               50.
  -397-

  UNALIAS                                                        (New)

  Purpose:     Remove aliases from the alias list.

  Format:      UNALIAS [/Q /R file...] [alias...]
                    or
               UNALIAS *

               alias:  One or more aliases to remove from memory.
               file:  One or more files to read for alias
               definitions.

               /Q(uiet)                 /R(ead file)

               See also:  ALIAS and ESET.

  Usage:       4DOS, 4OS2, and 4NT maintain a list of the aliases
               that you have defined.  The UNALIAS command will
               remove aliases from that list.  You can remove one or
               more aliases by name, or you can delete the entire
               alias list by using the command UNALIAS *.

               For example, to remove the alias DDIR:

                    c:\> unalias ddir

               To remove all the aliases:

                    c:\> unalias *

               If you keep aliases in a file that can be loaded with
               the ALIAS /R command (see page 183), you can remove
               the aliases by using the UNALIAS /R command with the
               same file name.  This is faster than removing each
               alias individually in a batch file, and can be more
               selective than using UNALIAS *.

  Options:     /Q(uiet):  Prevents UNALIAS from displaying an error
               message if one or more of the aliases does not exist.
               This option is most useful in batch files, for
               removing a group of aliases when some of the aliases
               may not have been defined.

               /R(ead):  Read the list of aliases to remove from a
               file.  The file format should be the same format as
               that used by the ALIAS /R command (see page 183).
               You can use multiple files with one UNALIAS /R
               command, for example:

                    c:\> unalias /r alias1.lst alias2.lst
  -398-

  UNLOCK      [4DOS]                                      (Compatible)

  Purpose:     Unlock a disk drive to disable exclusive access under
               Windows 95.

  Format:      UNLOCK [drive: ...]

               drive:  The drive or list of drives to unlock.

               See also:  LOCK.

  Usage:       UNLOCK is only available when 4DOS is running under
               Windows 95.

               UNLOCK unlocks the specified drive(s), reversing the
               effects of LOCK and allowing other sessions to access
               the drive(s).  See the warning under LOCK before
               using these commands.

               If no drives are specified, 4DOS will attempt to
               unlock all drives.
  -399-

  UNSET                                                          (New)

  Purpose:     Remove variables from the environment or disable file
               associations inherited from Windows.

  Format:      UNSET  [/M /Q /R file...] name...
                    or
               UNSET *

               name:  One or more variables to remove or file types
               to disable.
               file:  One or more files containing variable
               definitions.

               /M(aster environment)    /R(ead from file)
               /Q(uiet)

               See also:  ESET and SET.

  Usage:       UNSET removes one or more variables from the
               environment, or disables file associations
               "inherited" from Windows.

               For example, to remove the environment variable
               CMDLINE:

                    c:\> unset cmdline

               If you use the command UNSET *, all of the
               environment variables will be deleted:

                    c:\> unset *

               UNSET can be used in a batch file, in conjunction
               with the SETLOCAL and ENDLOCAL commands, to clear the
               environment of variables that may cause problems for
               applications run from that batch file.

               For more information on environment variables, see
               the SET command and the general discussions on pages
               21 and 107.

       4NT     You can also use UNSET to disable direct file
               associations that 4NT has inherited from Windows NT
               (see pages 20 and 77 for more details on inherited
               file associations).  If the first character of the
               variable name is a period [.], UNSET will look first
               for a matching environment variable to remove.  If it
               doesn't find one, it will next look in the list of
               direct file associations it has loaded from Windows
               NT.  UNSET will not modify Windows NT's file
               associations, just 4NT's copy of the associations.

           !   Use caution when removing environment variables, and
               especially when using UNSET *.  Many programs will
               not work properly without certain environment
  -400-

               variables; for example, 4DOS depends on PATH and
               COMSPEC, and 4OS2 uses PATH and DPATH.

  Options:     /M(aster):  Remove the variable from the master
       4DOS    environment rather than the local environment.  This
               option is only useful in secondary shells.

               /Q(uiet):  Prevents UNSET from displaying an error
               message if one or more of the variables or
               associations does not exist.  This option is most
               useful in batch files, for removing a group of
               variables when some of the variables may not have
               been defined.

               /R(ead):  Read environment variables to UNSET from a
               file.  This much faster than using multiple UNSET
               commands in a batch file, and can be more selective
               than UNSET *.  The file format should be the same
               format as that used by the SET /R command (see page
               360 for more details).
  -401-

  VER                                                       (Enhanced)

  Purpose:     Display the current command processor and operating
               system versions.

  Format:      VER [/R]

               /R(evision level)

  Usage:       Version numbers consist of a one-digit major version
               number, a separator, and a one- or two-digit minor
               version number.  VER uses the default decimal
               separator defined by the current country information.
               The VER command displays both version numbers:

                    c:\> ver

                    4DOS 6.00A   DOS 6.22

       4DOS    4DOS's VER command will automatically detect OS/2,
               Novell DOS / OpenDOS, and Windows 95 and display the
               corresponding operating system name and version
               number.  For example:

                    c:\> ver

                    4DOS 6.00A   OS/2 Warp 4.00
               or
                    4DOS 6.00A   (Win 95) DOS 7.10

  Option:      /R(evision level):  Display the command processor and
               operating system internal revision level (if any),
               plus your 4DOS, 4OS2, or 4NT serial number and
               registered name.

       4DOS    Under 4DOS, /R also displays whether DOS is loaded
               into the high memory area (HMA), is resident in ROM,
               or is in normal base memory.  This output is only
               meaningful in MS-DOS or PC-DOS version 5.0 or above
               or in an OS/2 DOS session.
  -402-

  VERIFY                                                  (Compatible)

  Purpose:     Enable or disable disk write verification or display
               the verification state.

  Format:      VERIFY [ON | OFF]

  Usage:       DOS and OS/2 maintain an internal verify flag.  When
               the flag is on, the operating system attempts to
               verify each disk write by making sure that the data
               written to the disk can be read back successfully
               into the computer.  It does not compare the data in
               memory with the data actually placed on disk to fully
               verify the disk write process.

       4NT     Disk write verification cannot actually be enabled or
               disabled under Windows NT.  4NT supports VERIFY as a
               "do-nothing" command, for compatibility with CMD.EXE.
               This avoids "unknown command" errors in batch files
               which use the VERIFY command.  The additional
               discussion below applies only to 4DOS and 4OS2, and
               not to 4NT.

               If used without any parameters, VERIFY will display
               the state of the verify flag:

                    c:\> verify
                    VERIFY is OFF

               VERIFY is off when the system boots up.  Once it is
               turned on with the VERIFY ON command, it stays on
               until you use the VERIFY OFF command or until you
               reboot.

               Verification will slow your disk write operations
               slightly (the effect is not usually noticeable).
  -403-

  VOL                                                       (Enhanced)

  Purpose:     Display disk volume label(s).

  Format:      VOL [d:] ...

               d:  The drive or drives to search for labels.

  Usage:       Each disk may have a volume label, created when the
               disk is formatted or with the external LABEL command.
               Also, every floppy disk formatted with DOS version
               4.0 or above, OS/2, or Windows NT has a volume serial
               number.

               The VOL command will display the volume label and, if
               available, the volume serial number of a disk volume.
               If the disk doesn't have a volume label, VOL will
               report that it is "unlabeled."  If you don't specify
               a drive, VOL displays information about the current
               drive:

                    c:\> vol
                    Volume in drive C: is MYHARDDISK

               If available, the volume serial number will appear
               after the drive label or name.

               To display the disk labels for drives A and B:

                    c:\> vol a: b:
                    Volume in drive A: is unlabeled
                    Volume in drive B: is BACKUP_2
  -404-

  VSCRPUT                                                        (New)

  Purpose:     Display text vertically in the specified color.

  Format:      VSCRPUT  row col [BRIght] [BLInk] fg ON [BRIght] bg
               text

               row:  Starting row number.
               col:  Starting column number.
               fg:  Foreground text color.
               bg:  Background text color.
               text:  The text to display.

               See also:  SCRPUT.

  Usage:       VSCRPUT writes text vertically on the screen rather
               than horizontally.  Like the SCRPUT command, it uses
               the colors you specify to write the text.  VSCRPUT
               can be used for simple graphs and charts generated by
               batch files.  See page 27 for details about colors
               and color names, and notes on the use of bright
               background colors.

               The row and column are zero-based, so on a standard
               25 line by 80 column display, valid rows are 0 - 24
               and valid columns are 0 - 79.  VSCRPUT checks for a
               valid row and column, and displays a "Usage" error
               message if either value is out of range.

               You can also specify the row and column as offsets
               from the current cursor position.  Begin the value
               with a plus sign [+] to move down the specified
               number of rows or to the right the specified number
               of columns before displaying text, or with a minus
               sign [-] to move up or to the left.

               If you specify 999 for the row, VSCRPUT will center
               the text vertically on the display.  If you specify
               999 for the column, VSCRPUT will center the text
               horizontally.

               VSCRPUT normally does not move the cursor when it
               displays the text.  However, under 4DOS if you have
               set OutputBIOS to Yes in 4DOS.INI (see below),
               VSCRPUT will leave the cursor at the end of the
               displayed text.

               The following batch file fragment displays an X and Y
               axis and labels them:

                    cls bright white on blue
                    drawhline 20 10 40 1 bright white on blue
                    drawvline 2 10 19 1 bright white on blue
                    scrput 21 20 bright red on blue X axis
                    vscrput 8 9 bright red on blue Y axis
  -405-

       4DOS ## VSCRPUT normally writes text directly to the screen.
               If you have an unusual display adapter which does not
               support direct video output, see the OutputBIOS
               directive on page 167.
  -406-

  WINDOW      [4OS2, 4NT]                                        (New)

  Purpose:     Minimize or maximize the current window, restore the
               default window size, or change the window title.

  Format:      WINDOW [MIN | MAX | RESTORE | /POS=x,y,width, height
               | /SIZE=rows,columns | "title"]

               title:  A new title for the window.

               /POS(ition)              /SIZE  (of screen buffer)

               See also:  ACTIVATE and TITLE.

  Usage:       WINDOW is used to control the appearance and title of
               the current window.  WINDOW MIN reduces the window to
               an icon, WINDOW MAX enlarges it to its maximum size,
               and WINDOW RESTORE returns the window to its default
               size and location on the desktop.

               You can use the /POS option to set the location and
               size of the window on the desktop.  The x and y
               values of the /POS option select the window's origin
               while the width and height values determine its size.

               If you specify a new title, the title text must be
               enclosed in double quotes.  The quotes will not
               appear as part of the actual title.

               You can only specify one WINDOW option at a time.
               The different options cannot be combined in a single
               WINDOW command.  To perform multiple operations, use
               multiple WINDOW commands.

  Options:     /POS(ition):  Set the window screen position and
               size.  The syntax is /POS=x,y,width,height where the
               values are specified in pixels or pels.  Under 4OS2,
               row and col refer to the position of the bottom left
               corner of the window relative to the bottom left
               corner of the screen.  Under 4NT, row and col refer
               to the position of the top left corner of the window
               relative to the top left corner of the screen.

       4NT     /SIZE  (of screen buffer):  Specify the screen buffer
               size.  The full syntax is /SIZE=rows, columns, where
               rows is the number of text rows and columns is the
               number of text columns.  Due to the design of Windows
               NT console sessions, you cannot use /SIZE to reduce
               the size of the screen buffer; it can only be
               increased.
  -407-

  Y                                                              (New)

  Purpose:     Copy standard input to standard output, and then copy
               the specified file(s) to standard output.

  Format:      Y file ...

               file:  The file or list of files to send to standard
               output.

               See also:  TEE.

  ##  Usage:   The Y command copies input from standard input
               (usually the keyboard) to standard output (usually
               the screen).  Once the input ends, the named files
               are appended to standard output.

               For example, to get text from standard input, append
               the files MEMO1 and MEMO2 to it, and send the output
               to MEMOS:

                    c:\> y memo1 memo2 > memos

               The Y command is most useful if you want to add
               redirected data to the beginning of a file instead of
               appending it to the end.  For example, this command
               copies the output of DIR, followed by the contents of
               the file DIREND, to the file DIRALL:

                    c:\> dir | y dirend > dirall

               If you are typing at the keyboard to produce input
               text for Y, you must enter a Ctrl-Z to terminate the
               input.

           !   When using Y with a pipe under 4OS2 or 4NT, you must
               take into account that the programs on the two ends
               of the pipe run simultaneously, not sequentially.
               See page 62 for more information.
