!WIDTH 80
!TOPIC 100 (c) 1990
!INDEX 1
The 4DOS help system was originally written by Ross Neilson Wentworth,
and is now owned and distributed by J.P. Software.  The program and help
text are Copyright 1989, 1990, Rex Conn and J.P. Software, All Rights
Reserved.  Portions Copyright 1987, 1988, TurboPower Software; portions
Copyright 1987, 1989, Borland International.

The help system is based on the TPHELP unit from TurboPower Software's
Turbo Professional 5.0 Turbo Pascal toolkit.

4DOS is a trademark of J.P. Software.  Other product names are
trademarks of their respective manufacturers.
!TOPIC 101 -HELP-
!INDEX 2
This online DOS help system for 4DOS is fully indexed and cross-indexed.
When first activated from the DOS prompt with the F1 key the topic index
is displayed.  The cursor keys can then be used to highlight a help topic.

While in the index, pressing an alphabetic key will move the highlighted box
to the first topic starting with that letter.  If you continue to press
alphabetic keys the string being entered will be displayed at the lower left
of the screen and the highlight bar will be placed on the first topic that
matches the entered string, moving, if necessary, to a new topic as the
string is being entered.

If a character is entered that results in no matching topic, the entered
string will be reset and the highlight bar will be placed on the first
topic that begins with that letter.

Pressing <RETURN> selects the highlighted help topic and displays the
appropriate text.

While help text is displayed you may use the PgUp and PgDn keys to page
through the text.  Pressing F1 will redisplay the index.

When viewing the index, pressing ESC will exit the help system and return
you to the DOS prompt.  When viewing a text screen, pressing ESC will
return you to the index.

If you go directly to a text screen (via a "HELP topic" command), pressing
ESC will exit directly back to the DOS prompt; to go the index, use F1.

Pressing ALT-F1 will display the previous help topic.  The list of
previous topics includes the last 15 topics viewed.

If there are any cross-references highlighted in the text you can use
the arrow keys and <RETURN> to select the topic.

For a keyboard quick-reference see 102KEYS.  For information on mouse
support see 103MOUSE.

!TOPIC 102 -KEYS-
!INDEX 3
4DOS Help Keyboard Quick Reference:

     F1      Displays the help index.
     Alt-F1  Displays the previous topic displayed (up to the last
             15 topics).
     PgDn    Display the next page of text for the current topic.
     PgUp    Display previous page of text for the current topic.
     27 26 24 25 Select a cross-indexed help topic.
     CR      Display help for the currently highlighted cross-indexed
             topic.
     Alt-N   Display help for the next (alphabetically) topic.
     Alt-P   Display help for the previous (alphabetically) topic.
     Alt-X   Exit help but keep the current screen displayed.
     ESC     Exit to the index, then to DOS; exit directly to DOS if
             HELP was started with an explicit topic.

For a more detailed description see 101HELP.  For information on mouse
support see 103MOUSE.
!TOPIC 103 -MOUSE-
!INDEX 4
The mouse is fully supported in this help system.  When the index is
displayed you can highlight a topic by positioning the mouse cursor on
the topic and pressing the left button.  Pressing the left button a
second time on that topic will display the help text.

While help text is displayed you can page through the text by placing the
mouse cursor on the right vertical bar on the screen and pressing the left
button.

Pressing the left button while highlighting the diamond in the upper left
corner displays previous help topics (same as the keyboard ALT-F1).

Pressing the left and right buttons together will redisplay the help index
(same as the keyboard F1).

Pressing the right button will exit to the menu or the DOS prompt (same as
the keyboard ESC).

If you have a 3-button mouse, pressing the right and center buttons together
will display the next help topic in index order.  Pressing the center and
left buttons together will go to the previous topic.  These operations are
equivalent to the keyboard Alt-N and Alt-P operations respectively.

For a keyboard quick-reference see 102KEYS; for more details see
101HELP.
!TOPIC 104 -EDITING-
!INDEX 5
Command Line Editing

4DOS provides a 255 character command line, with full editing capability.
The following keys have special meaning (the caret ^ means press the Control
key together with the specified key):

          27  Move the cursor left one character.
          26  Move the cursor right one character.
          24  Recall the previous command from the history list, or match
             a partial command entry with a history list entry.
          25  Recall the next command from the history list, or match a
             partial command entry with a history list entry.
         ^27  Move the cursor left one word.
         ^26  Move the cursor right one word.
       Home  Move the cursor to the beginning of the line.
      ^Home  Delete from the beginning of the line to the character
             preceding the cursor.
        End  Move the cursor to the end of the line.
       ^End  Delete from the cursor to the end of the line.
        Ins  Toggle between insert and overstrike mode.
        Del  Delete the character at the cursor.
  Backspace  Delete the character to the left of the cursor.
   CR or LF  Execute the command.
        Esc  Erase the entire line.
         ^L  Delete the word to the left of the cursor.
!LINE
^R or ^Bksp  Delete the word to the right of the cursor.
         ^C  Abort the command.
         ^D  Delete the history list entry, and erase the line.
         ^K  Save the command to the history list without executing it,
             and erase the line.
         F1  Call the on-line help (HELP.EXE).
!LINE
F8, F9, F10  An F9 will scan the filename (which may include the wildcard
             characters * and ?) at or immediately to the left of the
             cursor position, and replaces it with the first matching
             filename.  Pressing F9 again replaces it with the next
             matching filename; pressing F10 appends the next matching
             filename at the current cursor position.  Pressing F8 will
             retrieve the previous matching filename.  If you don't enter
             a filename, F9 defaults to *.*.  If you don't enter an
             extension, F9 appends a .*.
!TOPIC 105 -VARS-
!INDEX 6
4DOS Variables and Variable Functions

Environment variables are referenced in a command by starting the variable
name with a percent sign (%).  Two percent signs in a row (%%) signify a
percent sign character.  An environment variable name is terminated by
either another percent sign, or by an invalid character (see below).  To
pass a variable name (instead of the value) to a command (for example, in
INKEY or INPUT), you must precede it with two percent signs.

Environment variable names may be composed of any alphanumeric character,
plus the dash (-), underscore (_), and $ characters.  In addition to the
standard variable name characters, you can force 4DOS to accept any
sequence of characters as a valid variable name by enclosing it them square
brackets.  For example, %[AB##1] refers to an environment variable named
AB##1.

There are some variable names that have special meanings in 4DOS.  Only
CMDLINE, PATH and TMP are actually stored in the environment; the remainder
are internal to 4DOS, and cannot be viewed or modified with SET or ESET.
(The internal variable names are checked after variable expansion, so they
can be overridden by creating an environment variable of the same name.)

    # returns the number of command line arguments in a batch file.
    ? returns the exit code of the last external program.  This allows you
      to save an exit code in another variable and then process it later,
      or to see what a program is actually returning.
    CMDLINE is the fully expanded 255-character command line.  You can
      access it from an external program by searching the environment.
    PATH tells 4DOS where to search for executable files (.COM, .EXE, .BTM
      and .BAT) not in the current directory.  Some applications also use
      the PATH variable to find their files.
    TMP specifies where 4DOS should put the temporary pipe files (see
      Redirection in the 4DOS manual).
    _BG is the screen background color at the current cursor position.
    _CPU is the cpu type, returned as a string:
        86  8086 and 8088
        186  80186 and 80188
        200  NEC V20 and V30
        286  80286
        386  80386 and 80486
    _CWD is the current directory in the format d:\pathname.
    _CWDS has the same value as CWD, except it ensures the pathname ends in
      a backslash (\).
    _CWP is the current directory in the format \pathname.
    _CWPS has the same value as CWP, except it ensures the pathname ends in
      a backslash (\).
    _DATE contains the current system date, in the format mm-dd-yy (U.S.),
      dd-mm-yy (Europe), or yy-mm-dd (Japan).
    _DISK is the current disk (for example, C).
    _DOSVER is the current MS-DOS version (for example, 3.3).
    _FG is the screen foreground color at the current cursor position.
    _SHELL is the current shell nesting level (in swapping mode).  The
      root shell is 0.  If you are not in swapping mode, _SHELL returns 99.
    _TIME contains the current system time in the format hh:mm:ss.  The
      separator character may vary depending depending upon your country
      information.  (See 13CHCP.)

Variable Functions are pseudo-variables which take one or more arguments
(which can be environment variables or variable functions themselves), and
return a value.

    @ext[filename] returns the file extension (without a leading period)
    @full[filename] returns the fully qualified path name
    @len[string] returns the length of the string
    @line[filename,n] returns line "n" from the specified file
    @name[filename] returns the filename only (no path or extension)
    @path[filename] returns the path only (including trailing backslash)
    @search[filename] searches for the filename, using the PATH
      environment variable, and append an extension (.COM, .EXE,
      .BAT, .BTM, or executable extension) if one wasn't specified.
    @substr[string,start,length] returns a substring, starting at the
      position "start" and continuing for "length" characters.  If the
      length is negative, the start is relative to the right side.  For
      example, to get get the current time and extract the hour:

        %@substr[%_time,0,2]
!TOPIC 1 ?
SYNTAX        (Internal 4DOS)

?

PURPOSE

Display the 4DOS internal commands.
!TOPIC 2 ALIAS
SYNTAX        (Internal 4DOS)

ALIAS [/P][/R [d:][path]filename] [name[=][value]]

PURPOSE

Load or display the alias list, or define name as a substitute for value.

COMMENTS

Aliases are useful as a means of executing a complex series of commands
with a few keystrokes.  Aliases can also be used as in memory batch files,
and will run much faster than disk-based batch files.

If you only specify "name", ALIAS displays the current alias value for
"name".  Otherwise, ALIAS assigns the command(s) in "value" to "name".
"Name" can now be used as if it were a built-in or external command.  If
you don't specify any arguments, ALIAS displays the current alias list.

"Name" is limited to no more than 80 characters, and "value" to no more
than 255 characters.

The ALIAS options are:

    /P  Pause after displaying each page and wait for a key to be pressed.
    /R  Load an alias list from a file.  This is much faster than loading
        aliases from a batch file.  The file is in the same format as the
        ALIAS display, so ALIAS /R can accept as input a file generated by
        redirecting ALIAS output.  (You can add comments to an alias file by
        starting the comment line with a colon (:).)  For example, the
        following commands will save the aliases to a file, and then reload
        them from that file:

          alias > alist
          alias /r alist

When defining aliases at the command line, back quotes must be used around
the alias arguments that contain multiple commands or variable references
(%2, %&2, etc.) to prevent premature expansion.  Back quotes should NOT be
used when defining aliases in a file to be read with ALIAS /R.

Aliases may be nested; i.e., an alias can refer to another alias, but they
cannot refer back to themselves (a=b=a).  You can stop alias expansion by
prefacing the alias with an asterisk (*).  This also allows an alias to
refer to a command of the same name (see below for an example).

Alias names can be truncated by including an asterisk (*) in the name.

To remove an alias, use the 93UNALIAS command.

For more information on aliases (including the use of variables), see the
Aliases section in the 4DOS manual, and the sample file ALIASES distributed
with 4DOS.

EXAMPLE

Define D as an alias for DIR /AP:

    c:\> alias d dir /ap

Rename the LIST command to DISPLAY, and alias LIST to an external program:

    c:\> alias display *list
    c:\> alias list c:\util\list.com

The following examples show the use of alias arguments:

    c:\> alias zap `erase %& ^ chkdsk ^ dir /w`
    c:\> alias reverse `echo %5 %4 %3 %2 %1`
!TOPIC 3 ASSIGN
SYNTAX        (External MS-DOS)

ASSIGN [x=y [...]]

PURPOSE

Routes disk I/O requests to a different drive.

COMMENTS

ASSIGN allows you to use programs that use a preassigned disk drive (such
as A or B) with another drive (such as C).  The first argument specifies
the drive whose assignment you want to change, and the second argument is
the new assignment.  The equals sign (=) is optional.  Do not use a colon
after the drive letters.

EXAMPLE

Route all requests for drive A to drive C:

    c:\> assign A=C
!TOPIC 4 ATTRIB
SYNTAX        (Internal 4DOS)

ATTRIB [/D][-|+[AHRS]] [d:][path]filename ...

PURPOSE

Change the file or subdirectory attributes.

COMMENTS

ATTRIB normally only modifies file attributes.  Specifying the /D(irectory)
option will also modify subdirectory attributes.

The ATTRIB options are:

    +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 (write-protected)
    -R   Clear the read-only attribute
    +S   Set the system file attribute
    -S   Clear the system file attribute

4DOS will preserve the previous file attributes and change only the
specified attributes.  New attribute values are allowed between filenames;
otherwise ATTRIB uses the same attributes specified for the previous
file(s).  You cannot modify the directory or volume label attributes.

You can display the file attributes using the /A option in 24DIR.

EXAMPLE

Set the read-only and hidden attributes for the file MEMO:

    c:\> attrib +rh memo

Set the archive attribute (file has been modified) for MEMO and change
TEXT.COM to system and not modified:

    c:\> attrib +a memo +s -a test.com
!TOPIC 5 BACKUP
SYNTAX        (External MS-DOS)

BACKUP [d:][path]]filename][.ext] d:[/S][/M][/A][/D:mm-dd-yy]

PURPOSE

Backs up files from one disk to another.

COMMENTS

The first argument is the source, the second argument is the target.  You
can use the wildcard characters (* and ?) in the filename.

The BACKUP options are:

    /S  Backup subdirectory files in addition to the specified
        directory.
    /M  Backup only those files that have changed since the last backup.
    /A  Add files to be backed up to the files already on the backup
        disk.
    /D:mm-dd-yy  Backup files modified on or after the specified date

See also 72RESTORE and 98XCOPY.
!PAGE
EXAMPLE

Backup the fixed disk C to multiple floppies on A:

    c:\> backup c: a: /s

Backup all the files with a .C extension in the C:\PROGRAM directory to A:

    c:\> backup c:\cprogram\*.c a:
!TOPIC 6 BEEP
SYNTAX        (Internal 4DOS)

BEEP [frequency duration ...]

PURPOSE

Beep the speaker.

COMMENTS

BEEP is normally be used in batch files to signal that an operation has
been completed, or that the computer needs attention (for example, to
change disks).  Because BEEP allows you to specify the frequency and
duration, you can use it to play simple music.  You can specify multiple
frequency/duration pairs on the command line.

The frequency is specified in Hertz, and the duration in 1/18th second
intervals.  No sound will be generated for frequencies less than 20 Hz,
allowing you to insert short delays.  The default value for frequency is
440 Hz; the default value for duration is 2.

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

    C        131     262     523    1040    2093
    C#/Db    139     277     554    1103    2217
    D        147     294     587    1176    2349
    D#/Eb    156     311     622    1241    2489
    E        165     330     659    1311    2637
    F        175     349     698    1391    2794
    F#/Gb    185     370     740    1488    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    1866    3729
    B        248     494     988    1973    3951

EXAMPLE

The following batch file fragment runs the program DEMO, plays a few notes,
and waits for you to press a key:

    demo
    beep 440 4 587 2 1040 6
    pause Finished with the demo - press a key to continue
!TOPIC 7 BREAK
SYNTAX        (Internal 4DOS)

BREAK [on | off]

PURPOSE

Display, enable, or disable ^C / ^BREAK checking.

COMMENTS

BREAK turns the ^C / ^BREAK checking on or off.  If no argument is given,
it displays the current BREAK status.

If BREAK is off, MS-DOS will only check for a ^C during DOS character I/O
(screen, keyboard, serial port, or printer operations).  Many programs
don't use the MS-DOS functions to access the screen and keyboard, and it
can be difficult to break out of them with BREAK off.  If BREAK is on,
MS-DOS will check for a ^C or ^BREAK during any MS-DOS operation (including
disk I/O).

BREAK defaults to OFF.  You can change the default BREAK setting by adding
the following line to your CONFIG.SYS file:

    BREAK=ON

EXAMPLE

Check the current BREAK status:

    c:\> break
    BREAK is OFF

Enable ^C checking in all MS-DOS calls:

    c:\> break on
!TOPIC 8 CALL
SYNTAX        (Internal 4DOS)

CALL [d:][path]filename

PURPOSE

Call a secondary batch file.

COMMENTS

CALL allows batch files to call other batch files (batch file nesting)
without invoking a secondary copy of the command processor.  4DOS supports
batch file nesting up to four levels deep.  The calling batch file is
suspended while the called batch file runs.  When the called batch file
finishes, the calling batch file resumes execution at the next command.
If you execute a batch file from another batch file without using CALL,
the first batch file is terminated before the second one starts.

The current ECHO state will be inherited by a called batch file.

See also 9CANCEL and 67QUIT.
!PAGE
EXAMPLE

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

    input Enter your choice:  %%option
    if "%option" == "wp" call wp.bat
!TOPIC 9 CANCEL
SYNTAX        (Internal 4DOS)

CANCEL

PURPOSE

Terminate batch processing.

COMMENTS

The CANCEL command will end all batch file processing, regardless of the
batch 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.

See also 8CALL and 67QUIT.
!PAGE
EXAMPLE

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
!TOPIC 10 CD
SYNTAX        (Internal 4DOS)

CD [[d:][pathname]
       or
!LINE
CHDIR [[d:][pathname]

PURPOSE

Display or change the current directory.

COMMENTS

Entering CD with no argument or only a disk drive name will display the
current directory.  Entering CD and a pathname will change the current
directory.

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.
Use CDD to change both the drive and directory.

See also 12CDD and 66PUSHD.
!PAGE
EXAMPLE

Change to the subdirectory C:\FINANCE\MYFILES:

    c:\> cd \finance\myfiles

Change the default directory on drive A:

    c:\> cd a:\utility
!TOPIC 11 CHDIR

See 10CD.
!TOPIC 12 CDD
SYNTAX        (Internal 4DOS)

CDD [d:]pathname

PURPOSE

Change the current disk drive and directory.

COMMENTS

CDD is similar to CD, except it can also change the default disk drive.

To start at the root directory, start the pathname with a backslash (\).
To start at the parent directory, start the pathname with two periods (..).
All other pathnames start at the current directory.

MS-DOS will not accept a directory name longer than 64 characters.

See also 10CD and 66PUSHD.
!PAGE
EXAMPLE

Change from the root directory on drive A to the subdirectory C:\WP:

    a:\> cdd c:\wp
!TOPIC 13 CHCP
SYNTAX        (Internal 4DOS)

CHCP [n]

PURPOSE

Display or change the current system code page.

COMMENTS

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
board, and MS-DOS 3.3 or above.

Before using CHCP, you must 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 two prepared system code pages.  An error message
is displayed if a code page is selected that has not been prepared for the
system.

Entering CHCP with no argument displays the active code page.

See your MS-DOS manual for more information on CHCP.

EXAMPLE

Display the current code page:

    c:\> chcp
    Active code page: 437

Set the code page to multilingual:

    c:\> chcp 850
!TOPIC 14 CHKDSK
SYNTAX        (External MS-DOS)

CHKDSK [d:][filename[.ext]] [/F][/V]

PURPOSE

Checks the disk directories, files, and FAT, and reports on the disk and
memory status.

COMMENTS

If you specify a filename, CHKDSK will check the disk for fragmentation
and display a status report for the file.  You can use the MS-DOS wildcard
characters (* and ?) in the filename.

The CHKDSK options are:

    /F  Try to fix errors in the directory or FAT
    /V  Displays all files and their paths on the specified drive.

See also 40FREE and 56MEMORY.
!PAGE
EXAMPLE

Check drive C and correct any errors:

    c:\> chkdsk c: /f
!TOPIC 15 CLS
SYNTAX        (Internal 4DOS)

CLS [[bright] [blink] fg ON bg]

PURPOSE

Clear the video display, optionally to the specified colors.

COMMENTS

CLS clears the display and moves the cursor to the upper left corner.  fg
is the foreground color, bg the background color.  Only the first three
characters of the color name and attributes ("bright" and "blink") are
required.

You must have ANSI.SYS (or another ANSI compatible screen driver) loaded to
set screen colors.

The available colors are:

    Black      Blue      Green      Red
    Magenta    Cyan      Yellow     White

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

See also 16COLOR.

EXAMPLE

Clear the display:

        c:\> cls

Clear the display to a blue background, and set white characters as the
new default:

       c:\> cls white on blue
!TOPIC 16 COLOR
SYNTAX        (Internal 4DOS)

COLOR [[bright] [blink] fg ON bg]

PURPOSE

Set the screen display colors.

COMMENTS

fg is the foreground color, bg the background color.  Only the first
three characters of the color name and attributes ("bright" and "blink")
are required.

You must have ANSI.SYS (or another ANSI compatible screen driver) loaded to
set screen colors.

The available colors are:

    Black      Blue      Green      Red
    Magenta    Cyan      Yellow     White

See also 15CLS and 76SCRPUT.
!PAGE
EXAMPLE

Set the default screen colors to bright white text on a blue background:

       c:\> color bright white on blue
!TOPIC 17 COMP
SYNTAX        (External MS-DOS)

COMP [d:][path]filename [d:][path]filename

PURPOSE

Compares files.

COMMENTS

COMP compares individual files or sets of files byte for byte.  To compare
sets of files, specify only the drive, the path, or use the MS-DOS wildcard
characters (* and ?) in the filenames.

If the file sizes differ, COMP does not make the comparison.

COMP will display an error message for any location containing mismatched
information between the two files.  After ten mismatches, COMP aborts the
compare.

See also 26DISKCOMP.
!PAGE
EXAMPLE

Compare the files MEMO.DOC and MEMO.BAK:

    c:\> comp memo.doc memo.bak
!TOPIC 18 COPY
SYNTAX        (Internal 4DOS)

COPY [/MPQRUV] [d:][path]filename[+]...[/A/B] [[d:][path]filename][/A/B]

PURPOSE

Copy or append one or more files.

COMMENTS

Unlike COMMAND.COM, 4DOS allows you to copy several unrelated files to a
target directory with a single COPY command.  If there are two or more
arguments on the command line, COPY assumes the last argument is the
target.  If there is only one argument, the target is assumed to be the
current directory.

The plus (+) tells 4DOS to append two or more files to a single target
file.  If you don't specify a target, COPY will append each subsequent
file to the first file.

If you specify more than one source file, and the target is NOT a
directory, COPY will automatically append the files to the target.

The /A(SCII) or /B(inary) options apply to the preceding filename and to
all subsequent filenames on the command line until another /A or /B is
entered.  The other options (/M, /P, /Q, /R, /U, /V) apply to all filenames
on the command line.

The COPY options are:

    /A  If used with a source filename, 4DOS will copy the file up
        to, but not including, the first ^Z character in the file.  If you
        use /A with a target filename, 4DOS will add a ^Z to the end of the
        file.  4DOS defaults to /A when appending files, or when the source
        or target is a device.
    /B  If used with a source filename, 4DOS will copy the entire file.
        Using /B with a target filename prevents 4DOS from adding a ^Z to
        the end of the target file.  4DOS defaults to /B for normal file
        copies.
    /M  Copy only those files with the archive bit set (see ATTRIB).  The
        archive bit will NOT be cleared after copying.
    /P  Confirm each file copy (Y or N).  An N response will skip that
        particular file.
    /Q  Don't display filenames as they are copied.
    /R  Prompt before overwriting an existing file.
    /U  Copy only those source files that are newer than a matching target
        file, or where a matching target file doesn't exist.
    /V  Verify each disk write.  This is the same as executing the VERIFY
        ON command, but is only active during the COPY.

See also 60MOVE and 98XCOPY.

EXAMPLE

Copy the files MEMO1, PROJECT8.WKS, and UPDATE.BAT to the root directory on
drive A:

    c:\> copy memo1 project8.wks a:\

Append the files MEMO1, MEMO2, and MEMO3 and store the result in BIGMEMO:

    c:\> copy memo1+memo2+memo3 bigmemo

Copy only those files in the root directory on drive A that are newer than
the matching files in the current directory, or which don't exist in the
current directory:

    c:\> copy /u a:\*.* c:\*.*

Copy files from the root directory on drive A to the current directory, but
prompt before overwriting existing files:

    c:\> copy /r a:\*.*

Copy a downloadable font file to the printer in binary mode:

    c:\> copy myfont.dat lpt1: /b
!TOPIC 19 CTTY
SYNTAX        (Internal 4DOS)

CTTY device

PURPOSE

Change the default console device.

COMMENTS

At startup, 4DOS uses the keyboard as the standard input device and the
display as the standard output device.  CTTY allows you to change the
console (CON:) to another device that can perform standard character I/O.

CTTY works only for those programs that use the standard MS-DOS I/O
functions (this includes all of the internal 4DOS commands with the
exception of DRAWBOX, DRAWHLINE, DRAWVLINE, LIST, SCREEN, SCRPUT, and
SELECT).
!PAGE
EXAMPLE

Change the console to the first serial port:

    c:\> ctty com1:

Change the console back to the standard keyboard and display:

    c:\> ctty con:
!TOPIC 20 DATE
SYNTAX        (Internal 4DOS)

DATE [mm-dd-yy]

PURPOSE

Display and (optionally) change the system date.

COMMENTS

If you don't enter any parameters, DATE will display the current system
date and time, and prompt for the new date.  Press ENTER if you don't wish
to change the date, otherwise enter the new date.

The parameters for the DATE command are:

     mm (month) = 1 - 12
     dd (day)   = 1 - 31
     yy (year)  = 80 - 199 (1980 - 2099)

You can use hyphens, slashes, or periods to separate the month, day, and
year entries.

The format for the date entry depends on the country code defined in the
CONFIG.SYS file or by the CHCP command.  The default format is U.S.
(mm-dd-yy).  The European format is dd-mm-yy; the Japanese is yy-mm-dd.

See also 13CHCP and 89TIME.

EXAMPLE

Enter the date from the command line:

    c:\> date 12/25/89

To be prompted for the date:

    c:\> date
    Mon  Dec 25, 1989  9:30:06
    Enter new date (mm-dd-yy):
!TOPIC 21 DEL
SYNTAX        (Internal 4DOS)

DEL [/P] [d:][path]filename...
       or
!LINE
ERASE [/PQY] [d:][path]filename...

PURPOSE

Erase the specified file(s) from the disk.

COMMENTS

The DEL options are:

    /P  Confirm file deletion for each file.
    /Q  Don't display filenames as they are deleted.
    /Y  The reverse of /P - it assumes a Y response to everything,
        including deleting an entire subdirectory.  Use with caution!

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(es) option.  If you respond with a Y, DEL will delete all the files in
that subdirectory (except for hidden, system, and read-only files).
!PAGE
EXAMPLE

Erase all the files in the current directory with a .BAK or .PRN extension:

    c:\> del *.bak *.prn
!TOPIC 22 DELAY
SYNTAX        (Internal 4DOS)

DELAY [seconds]

PURPOSE

Pause for a specified period of time.

COMMENTS

DELAY is useful in batch file loops while waiting for a condition to occur.
The default value is one second.

You can cancel a DELAY loop by pressing ^C.

EXAMPLE

Wait for 10 seconds:

    delay 10
!TOPIC 23 DESCRIBE
SYNTAX        (Internal 4DOS)

DESCRIBE [d:][path]filename ...

PURPOSE

Create, modify, or delete file and subdirectory descriptions.

COMMENTS

DESCRIBE adds descriptions (up to 40 characters) to MS-DOS filenames and
subdirectories.  The descriptions will be displayed when using DIR with the
default single column option, or when using SELECT.

File descriptions allow you to identify your files in much more meaningful
ways than MS-DOS allows in an eight character filename.

You can enter a description on the command line by entering the filename
followed by the description enclosed in quotes.  Using wildcards (* and/or
?) and/or multiple filenames with a description on the command line will
give all matching files the same description.

Descriptions are stored in each directory in a hidden file called
DESCRIPT.ION.  Use the ATTRIB command to "unhide" this file if you need to
copy or delete it.

The description file is modified appropriately whenever you perform an
internal command (such as COPY, DEL, MOVE, or RENAME), but not if you use
an external command (such as XCOPY or a shell program).

See also 24DIR and 77SELECT.

EXAMPLE

Create a description for the file MEMO.TXT:

    c:\> describe memo.txt
    Describe "memo.txt": Memo to Bob about party
!TOPIC 24 DIR
SYNTAX        (Internal 4DOS)

DIR [/124ACDFHJNOeirtuzPQSVWX] [[d:][path]filename[+]...]

PURPOSE

Display information about files and subdirectories.

COMMENTS

DIR displays information about the files and subdirectories in the
specified directory.  Depending upon the options specified, DIR can show
the filename, file attributes, size, date and time of the most recent
change to the file, and the file description.

DIR allows wildcard characters (* and ?) in the filename.  If you don't
specify a filename, DIR defaults to *.* (display all files and
subdirectories in the current directory).

If you append filenames with a +, 4DOS will display the matching filenames
in a single directory listing.

If a country code was defined in the CONFIG.SYS file or by the CHCP
command, DIR will display the date in the format for that country.  The
default date format is U.S. (mm-dd-yy).

DIR can handle directories of any size, limited only by the available
memory.  Each filename requires 32 bytes of DOS memory plus the size of
the description (if any); a system with 128K of free DOS memory can
display up to 4,000 files per directory.

Options on the command line apply only to the filenames which follow the
option, except that options at the end of the line apply to the preceding
filename only.  This allows you to specify several options for a group of
files, and retains compatibility with COMMAND.COM when a single filename
is specified.

The DIR options are:

    1  Single column display - display the filename, size, date, time, and
       description.  This is the default.
    2  Two column display - display the filename, size, date, and time.
    4  Four column display - display the filename and size, in K(ilobytes)
       or M(egabytes).
    A  Display the filenames and attributes only (see ATTRIB), in the
       format RHSA, where:
         R  Read only
         H  Hidden
         S  System
         A  Archive
       When displaying attributes, DIR cannot display file descriptions.
    C  Display filenames in upper case (like COMMAND.COM).  See also
       79SETDOS /U.
    D  Display contents of the current directory and all of its subdirec-
       tories.  DIR will only display headers and summaries for those
       directories with matching filenames.
    F  Display files only (no subdirectories).
    H  Display all files, including hidden and system files.
    J  Justify filenames (same format as COMMAND.COM).
    N  Reset DIR options to the default values (useful when displaying some
       files in one format, and then changing back to the default format.
    O? Sort sequence, where ? can be any combination of the following
       options:
         e  Sort by extension
         i  Sort by the file description
         r  Reverse the normal sort order
         t  Sort by time (oldest first)
         u  Unsorted (same as COMMAND.COM)
         z  Sort by size
       The default sort is by filename.
    P  Pause after each screen page and wait for a key to be pressed
       (useful for displaying long directory listings).
    Q  Suppress header line and summaries, and display file or subdirec-
       tory names only, in a single column (useful when redirecting output
       to a file or another program).
    S  Display summary only (number of files & bytes used).
    V  Display filenames sorted vertically rather than horizontally (with
       the /2, /4, or /W option.
    W  Wide display - display the filenames only, horizontally across the
       screen (5 columns on an 80-character display).
    X  Display subdirectories only.

See also 23DESCRIBE and 77SELECT.

EXAMPLE

Display the .WKS files, and then the .WK1 files in the current directory:

    c:\> dir *.wks *.wk1

Display the .WKS and .WK1 files together:

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

Display the files on drive C, including hidden and system files, pausing
after each page:

    c:\> dir /dhp c:\*.*
!TOPIC 25 DIRS
SYNTAX        (Internal 4DOS)

DIRS

PURPOSE

Display the current directory stack.

COMMENTS

DIRS displays the directory stack used by PUSHD and POPD, most recent
entries first.  The stack holds 255 characters (about 10 to 20 entries).

See also 66PUSHD and 63POPD.
!PAGE
EXAMPLE

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:\
!TOPIC 26 DISKCOMP
SYNTAX        (External MS-DOS)

DISKCOMP [d:] [d:] [/1] [/8]

PURPOSE

Compare the contents of two diskettes.

COMMENTS

DISKCOMP compares diskettes on a track-for-track basis.  It will not work
on fixed or virtual disks.

DISKCOMP does not recognize drive assignments made with ASSIGN.

The DISKCOMP options are:

    /1  Compare only the first side ot the disks.
    /8  Compare only 8 sectors per track.

See also 27DISKCOPY.
!PAGE
EXAMPLE

Compare the disks in A and B:

    c:\> diskcomp a: b:
!TOPIC 27 DISKCOPY
SYNTAX        (External MS-DOS)

DISKCOPY [d:] [d:] [/1]

PURPOSE

Copy diskettes

COMMENTS

DISKCOPY copies diskettes only.  It will not work on fixed or virtual
disks.  DISKCOPY does not recognize drive assignments made with ASSIGN.

The first drive is the source, the second drive is the target.

The only option for DISKCOPY is:

    /1  Copy only the first side of the diskette.

See also 18COPY, 98XCOPY and 26DISKCOMP.
!PAGE
EXAMPLE

Make a copy of the diskette in drive A to drive B:

    c:\> diskcopy A: B:
!TOPIC 28 DRAWBOX
SYNTAX        (Internal 4DOS)

DRAWBOX ulrow ulcol lrrow lrcol style [bright][blink] fg ON bg [FILL bgfill]

PURPOSE

Draw a box on the screen.

COMMENTS

DRAWBOX is useful for creating attractive screen displays in batch files.
DRAWBOX 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).

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.

The DRAWBOX parameters are:

    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 - borderless
                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)

Only the first three characters of the color name and attributes ("bright"
and "blink") are required.  The available colors are:

    Black      Blue      Green      Red
    Magenta    Cyan      Yellow     White

See also 29DRAWHLINE and 30DRAWVLINE.
!PAGE
EXAMPLE

Draw a single line box around the entire screen with bright white lines on
a blue background:

    drawbox 0 0 24 79 1 bright white on blue fill blue
!TOPIC 29 DRAWHLINE
SYNTAX        (Internal 4DOS)

DRAWHLINE row columns length style [bright] [blink] fg ON bg

PURPOSE

Draw a horizontal line on the screen.

COMMENTS

DRAWHLINE is useful for creating attractive screen displays in batch files.
DRAWHLINE 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).

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.

The DRAWHLINE parameters are:

    row     Start row
    column  Start column
    length  Length of line
    style   Line drawing style:
                1 - single line
                2 - double line
    fg      Foreground character color
    bg      Background character color

Only the first three characters of the color name and attributes ("bright"
and "blink") are required.  The available colors are:

    Black      Blue      Green      Red
    Magenta    Cyan      Yellow     White

See also 28DRAWBOX and 30DRAWVLINE.

EXAMPLE

Draw a double line along the top row of the display with green characters
on a blue background:

    drawhline 0 0 79 2 green on blue
!TOPIC 30 DRAWVLINE
SYNTAX        (Internal 4DOS)

DRAWVLINE row columns length style [bright] [blink] fg ON bg

PURPOSE

Draw a vertical line on the screen.

COMMENTS

DRAWVLINE is useful for creating attractive screen displays in batch files.
DRAWVLINE 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).

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.

The DRAWVLINE parameters are:

    row     Start row
    column  Start column
    length  Length of line
    style   Line drawing style:
                1 - single line
                2 - double line
    fg      Foreground character color
    bg      Background character color

Only the first three characters of the color name and attributes ("bright"
and "blink") are required.  The available colors are:

    Black      Blue      Green      Red
    Magenta    Cyan      Yellow     White

See also 28DRAWBOX and 29DRAWHLINE.

EXAMPLE

Draw a double line along the left margin of the display with bright red
characters on a black background:

    drawvline 0 0 24 2 bright red on black
!TOPIC 31 ECHO
SYNTAX        (Internal 4DOS)

ECHO [on | off | message]

PURPOSE

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

COMMENTS

4DOS defaults to ECHO ON in batch files.  To prevent a line from being
echoed, preface it with the @ symbol.  You can default to ECHO OFF by
setting the variable VERBOSE to 0 (see SETDOS).  The current ECHO state
is inherited by called batch files.

4DOS defaults to ECHO OFF during keyboard input.  If you set ECHO ON from
the command line, 4DOS will display the fully parsed and expanded commands
(including aliases and variables) before they are executed.  The keyboard
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.

If no arguments are entered, ECHO displays the current echo state.

ECHO commands in a batch file will send messages to the screen while the
batch file executes, even if ECHO is set OFF.  You cannot use the command
separator character or the 4DOS redirection symbols (|><) in an ECHO
message, unless you enclose them in quotes or precede them with the escape
character.

See also 79SETDOS, 75SCREEN, 76SCRPUT and 88TEXT.

EXAMPLE

Enable command line echoing:

    c:\> echo on

Display a message in a batch file:

    echo Processing your print files...

Turn off batch file echoing, without displaying the ECHO command itself:

    @echo off
!TOPIC 32 ENDLOCAL
SYNTAX        (Internal 4DOS)

ENDLOCAL

PURPOSE

Restore the saved disk drive, directory, environment, and aliases.

COMMENTS

ENDLOCAL restores the disk drive, directory, environment variables and
aliases saved by the previous SETLOCAL command.  SETLOCAL and ENDLOCAL can
only be used in batch files, not in aliases.

See also 80SETLOCAL.
!PAGE
EXAMPLE

This batch file fragment saves the aliases, environment, drive, and current
working directory, changes the drive and directory, modifies some
environment variables, runs the program TEST1, and then restores the
original values:

    setlocal
    cdd d:\test
    set path=c:\;c:\dos;c:\util
    set lib=d:\lib
    test1
    endlocal
!TOPIC 33 ERASE

See 21DEL.
!TOPIC 34 ESET
SYNTAX        (Internal 4DOS)

ESET varname ...

PURPOSE

Edit environment variables and/or aliases.

COMMENTS

ESET allows you to edit your environment variables and aliases using the
4DOS line editing commands (see the Command Line Editing section in the
4DOS manual).  The cursor will be positioned at the first character of the
variable or alias.

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
only be able to edit the environment variable.

4DOS limits environment variable and alias names to 80 characters, and
their arguments to 255 characters.

See also 2ALIAS, 93UNALIAS, 78SET, and 94UNSET.
!PAGE
EXAMPLE

Edit the MS-DOS executable file search path:

    c:\> eset path

Create and then edit an alias:

    c:\> alias d dir /djp
    c:\> eset d
!TOPIC 35 EXCEPT
SYNTAX        (Internal 4DOS)

EXCEPT ([d:][path]filename...) command [args...]

PURPOSE

Perform a command, except on the file(s) specified.

COMMENTS

EXCEPT provides a means of executing a command on a group of files and/or
subdirectories, except those enclosed within the parentheses.

The command can be a 4DOS internal command or alias, an external command,
or a batch file.

You may use the wildcard characters (? and *) in a filename.

When using filename completion (see Command Line Editing in the 4DOS
manual) to get the filenames inside the parentheses, type a space after
the open parenthesis before entering a partial filename or pressing F9.
Otherwise the command line editor will treat the open parenthesis as the
first character of the filename to be completed.

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

EXCEPT will not work with programs or commands that ignore the hidden
attribute.

See also 4ATTRIB.

EXAMPLE

Erase all but the files beginning with MEMO and those ending in .WKS:

    c:\> except (memo*.* *.wks) del *.*
!TOPIC 36 EXIT
SYNTAX        (Internal 4DOS)

EXIT

PURPOSE

Return from a secondary command processor.

COMMENTS

Some application programs will start a secondary copy of the command
processor to allow you execute MS-DOS commands.  To return to the
application again, type EXIT.

You cannot EXIT from the primary command processor.

EXAMPLE

Return to the previous command processor or application:

    c:\> exit
!TOPIC 37 FIND
SYNTAX        (External MS-DOS)

FIND [/V][/C][/N] "string" [d:][path]filename...

PURPOSE

Searches files for a specified string.

COMMENTS

You cannot use wildcard characters in the filenames.

The FIND options are:

    /V  Display all lines NOT containing the string.
    /C  Display the number of lines containing the string.
    /N  Display the line number of each matching line.
!PAGE
EXAMPLE

Search for the string "4DOS" in the file 4DOS.DOC, and display the line
numbers it appears on:

    c:\> find /n "4DOS" 4dos.doc
!TOPIC 38 FOR
SYNTAX        (Internal 4DOS)

FOR %%var IN (set) [DO] command

PURPOSE

Repeat a command for several variables.

COMMENTS

4DOS sets "var" sequentially to each member of "(set)", and then evaluates
and executes "command" for every argument in "(set)". If one of the
arguments in "(set)" contains MS-DOS wildcard characters (* and ?), "var"
will be set sequentially to each matching filename on the disk.

The command can be a 4DOS internal command or alias, an external command,
or a batch file.

In COMMAND.COM, you must use a single % for the variable name from the
command line, and %% when in a batch file.  4DOS will accept either % or
%% in either case.

COMMAND.COM requires the variable name to be a single character; 4DOS
supports variable names up to 80 characters.

COMMAND.COM requires the word DO on the command line; it is optional in
4DOS.

Note that 4DOS supports nested FOR statements; COMMAND.COM does not.

EXAMPLE

The following example compiles the C programs in the current directory that
have a "2" or a "3" somewhere in their name:

    c:\msc> for %%a in (*2*.c *3*.c) do cl %%a ;

The following example uses variable functions to delete the .BAK files for
which a corresponding .TXT file exists in the current directory:

    c:\docs> for %a in (*.txt) if exist %@name[%a].bak del %@name[%a].bak
!TOPIC 39 FORMAT
SYNTAX        (External MS-DOS)

FORMAT [d:][/S][/1][/8][/V][/B][/4]

PURPOSE

Format (initialize) a disk.

COMMENTS

FORMAT analyzes a disk for any defective tracks and prepares the disk
for MS-DOS files.  It initializes the directory and sets up the file
allocation table (FAT) and the system loader.

If you do not specify a drive, FORMAT will format the default drive.

The FORMAT options are:

    /S  Copy the operating system files to the new disk.
    /1  Format a diskette for single-sided use.
    /8  Format a diskette for 8 sectors per track.
    /V  Prompt for a disk volume label.
    /B  Leave space on a disk for the system files (IBMBIO.COM and
        IBMDOS.COM).  You can add them later with the SYS command.
    /4  Formats a double-sided diskette in a high-capacity drive.

The FORMAT command will destroy all files on the disk.

See also 27DISKCOPY.

EXAMPLE

Create a boot disk in the drive A:

    c:\> format a: /s
!TOPIC 40 FREE
SYNTAX        (Internal 4DOS)

FREE [d:] ...

PURPOSE

Display the total disk space, total bytes used, and total bytes free on the
specified (or default) drive(s).

COMMENTS

FREE provides the same disk information as the external MS-DOS command
CHKDSK, but without the wait.

See also 14CHKDSK and 56MEMORY.

EXAMPLE

Display the status of drives A, B, and C:

    c:\> free a: b: c:
!TOPIC 41 GLOBAL
SYNTAX

GLOBAL [/I] command [args]

PURPOSE

Execute a command in the current directory and its subdirectories.

COMMENTS

GLOBAL performs the specified command first in the current directory, and
then in every subdirectory under the current directory.

The command can be a 4DOS internal command or alias, an external command,
or a batch file.

GLOBAL will terminate if the command returns a non-zero exit code, unless
you specify the /I(gnore result) switch.
!PAGE
EXAMPLE

Erase all the files with a .BAK extension in every directory on C:

    c:\> global erase c:\*.bak

Copy the files in every directory on drive A to the directory C:\TEMP:

    c:\> global copy a:\*.* c:\temp
!TOPIC 42 GOSUB
SYNTAX        (Internal 4DOS)

GOSUB label

PURPOSE

Call a subroutine in a batch file.

COMMENTS

GOSUB calls the specified label as a subroutine.  The subroutine must end
with a RETURN statement.  After the RETURN, 4DOS will continue processing
with the command following the GOSUB command.

If the label doesn't exist, the batch file is terminated with the error
message "Label not found."

The label must begin with a colon (:), and appear by itself on the line.
4DOS ignores case differences when matching labels.

See also 43GOTO and 74RETURN.
!PAGE
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 /hw
    return
!TOPIC 43 GOTO
SYNTAX        (Internal 4DOS)

GOTO label

PURPOSE

Continue batch file processing at the line following the label.

COMMENTS

GOTO changes the current position in the batch file to the line immediately
following the label.  If the label doesn't exist, the batch file is
terminated with the error message "Label not found."

The label must begin with a colon (:), and appear by itself on the line.
4DOS ignores case differences when matching labels.

See also 42GOSUB.
!PAGE
EXAMPLE

The following batch file fragment checks for the existence of the file
CONFIG.SYS.  If the file exists, 4DOS jumps to C_EXISTS and copies all
the files from the current directory to the root directory on A.  If
CONFIG.SYS doesn't exist, 4DOS 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:\
!TOPIC 44 GRAFTABL
SYNTAX        (External MS-DOS)

GRAFTABL

PURPOSE

Load a character table to allow the CGA to display ASCII values above 127.

COMMENTS

Use GRAFTABL to display the foreign language and line-drawing characters
while in graphics mode on the CGA (color graphics adapter).

This command increases the size of MS-DOS by approximately 1K.
!TOPIC 45 HISTORY
SYNTAX        (Internal 4DOS)

HISTORY [/F][/R [d:][path]filename]

PURPOSE

Display, read, or clear the history list.

COMMENTS

If no parameters are entered, HISTORY displays the current history list.

The HISTORY options are:

    /F  Clear the command history list.
    /R  Read the command history from the specified file. You can save the
        history list by redirecting its output to 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
512 to 8192 characters.  The default size is 1024 characters.

You can disable saving commands to the history list, or specify a minimum
command line length to save, with the SETDOS /H command.

See also 79SETDOS.

EXAMPLE

Display the history list:

    c:\> history

Clear the history entries:

    c:\> history /f

Save the history list to the file HISTFILE, and then read it in again:

    c:\> history > histfile
    c:\> history /r histfile
!TOPIC 46 IF
SYNTAX        (Internal 4DOS)

IF [NOT] condition command

PURPOSE

Allow conditional execution of commands.

COMMENTS

4DOS first tests the given condition.  If the condition is true, 4DOS
executes the specified command, otherwise the command will be ignored.  If
you use the NOT option, the command is executed only when the condition is
false.  IF statements can be nested.

The command can be a 4DOS internal command or alias, an external command,
or a batch file.

For the string tests, case differences are ignored.  When comparing
strings, you should enclose them in double quotes (see examples).

The condition can be any of the following:

    string1 == string2
    string1 EQ string2
        If string1 is equal to string2, the condition is true.

    string1 NE string2
        If string1 is not equal to string2, the condition is true.

    string1 LT string2
        If string1 is < string2, the condition is true.

    string1 LE string2
        If string1 is <= string2, the condition is true.

    string1 GE string2
        If string1 is >= string2, the condition is true.

    string1 GT string2
        If string1 is > string2, the condition is true.

    ATTRIB [dL][path]filename [RHSVDA]
        If the file has matching attributes, the condition is true.  See
        also ATTRIB and DIR.  The attributes are:
           R  Read-only
           H  Hidden
           S  System
           V  Volume
           D  Directory
           A  Archive

    DISKFREE n[K | M]
        Test for the free disk space on the current drive.

    DOSMEM n[K]
        Test for the free DOS memory.

    EMS n[K | M]
        Test for the amount of free expanded memory.

    ERRORLEVEL number
        Test the exit code of the preceding external program.  ERRORLEVEL
        supports the same conditions as the string comparisons (for
        example, ==, LE, etc.).  If no condition is specified, the default
        is GE.  NOTE:  Not all programs return an explicit exit code.  In
        those cases, the behavior of ERRORLEVEL is undefined.

    EXIST [d:][path]filename
        If the file exists, the condition is true.  You can use wildcard
        characters (* and ?) in the filename, in which case the condition
        is true if any file matching the wildcards exists.

    EXTENDED n[K | M]
        Test for the amount of extended memory (non-XMS).

    FILESIZE filename n[K | M]
        Test for the size of the specified file.

    ISALIAS aliasname
        If the specified name is an alias, the condition is true.

    ISDIR [d:]path
        If the subdirectory exists, the condition is true.

    MONITOR [MONO | COLOR]
        Test for the monitor type.

    VIDEO [MONO | CGA | EGA | VGA]
        Test for the video card type.

    XMS n[K | M]
        Test for the amount of available XMS 2.0 extended memory.

The DOSMEM, EMS, EXTENDED, and XMS tests allow testing either by bytes
(default), kilobytes (by appending a K to the test value), or megabytes
(by appending an M).

See also 47IFF.

EXAMPLE

Test for the presence of A:\JAN.DOC and copy it to the root directory on
drive C if it exists:

    c:\> if exist a:\jan.doc copy a:\jan.doc c:\

This batch file fragment tests for a string value:

    if "%cmd" == "wp" goto wordproc
    if "%cmd" NE "graphics" goto badentry

Test for more than 500K of free DOS memory:

    c:\> if dosfree gt 500K echo More than 500K free

Test for expanded memory greater than 2 Mb:

    c:\> if ems gt 2M echo More than 2Mb EMS available

Run the program MONOPROG if the monitor type is monochrome:

    c:\> if montor mono monoprog

This batch file fragment tests to see if the disk in drive A is labeled
INSTALL1:

    if attrib a:\install1 V goto INSTALL1
!TOPIC 47 IFF
SYNTAX        (Internal 4DOS)

IFF [NOT] condition THEN ^ ... ^ ELSE[IFF] ^ ... ^ ENDIFF

PURPOSE

Allow IF/THEN/ELSE conditional execution of commands.

COMMENTS

4DOS first tests the given condition.  If the condition is true, 4DOS
executes the specified command(s) until the next ELSE, ELSEIFF, or ENDIFF;
otherwise the command(s) will be ignored and 4DOS will continue parsing at
the next ELSE, ELSEIFF, or ENDIFF.  If you use the NOT option, commands are
executed only when the condition is false.  IFF statements can be nested up
to 15 levels deep.

The command can be a 4DOS internal command or alias, an external command,
or a batch file.

See the 46IF command for a list of the tests available.
!PAGE
EXAMPLE

The following batch file fragment tests the monitor type (monochrome or
color), and sets the appropriate colors and prompt:

    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 following alias 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 zap `iff isdir %1 then ^ del %1 ^ rd %1 ^ else ^
           echo Not a directory! ^ endiff`
!TOPIC 48 INKEY
SYNTAX        (Internal 4DOS)

INKEY [/Wn] [text] %%varname

PURPOSE

Get a single keystroke environment variable from standard input.

COMMENTS

You can optionally display prompt text before the variable name.

The only INKEY option is:

    /W  Timeout period, where "n" is the number of seconds to wait for a
        response.  If no keystroke is entered by the end of the timeout
        period, INKEY returns with the variable unchanged.  You can specify
        /W0 to check if a keystroke is waiting, and return immediately.

ASCII values from 1 to 255 are stored as a character.  Extended characters
(for example, function keys & cursor keys) are stored as a string in
decimal format, with a leading @ (for example, the F1 key is stored as
@59).  This is the same format used by the KEYSTACK command.  See 51KEYSTACK
for a list of the extended key codes.

INKEY and INPUT are normally used as batch file commands, allowing you
great flexibility in entering or changing batch variables.

If you press ^C or ^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 prompted whether to cancel the batch job.

See also 49INPUT and 51KEYSTACK.

EXAMPLE

Prompt for a character and store it in the variable NUM:

    inkey Enter a number from 1 to 9:  %%num

The following batch file fragement waits up to 10 seconds for a character,
then tests to see if a "Y" was entered:

    set net=N
    inkey /w10 Do you want to load the network (Y/N)? %%net
    if "%net"=="Y" goto load_net
!TOPIC 49 INPUT
SYNTAX        (Internal 4DOS)

INPUT [/Wn] [text] %%varname

PURPOSE

Enter an environment variable from the standard input.

COMMENTS

You can optionally display prompt text before the variable name.

The only INPUT option is:

    /W  Specify a timeout period, where "n" is the number of seconds to
        wait for a response.  If no keystroke is entered by the end of the
        timeout period, INPUT returns with the variable unchanged.  If you
        enter a key before the timeout period, INPUT will wait indefinitely
        for the remainder of the line.  You can specify /W0 to check if a
        key is already in the buffer, and return immediately.

All characters entered up to, but not including, the carriage return are
stored in the variable.

INPUT and INKEY are normally used as batch file commands, allowing you
great flexibility in entering or changing batch variables.

See also 48INKEY.

EXAMPLE

The following batch file fragment prompts for a string and stores it in the
variable FNAME:

    input Enter the file name:  %fname
!TOPIC 50 JOIN
SYNTAX        (External MS-DOS)

JOIN
!LINE
JOIN d: d:\path
!LINE
JOIN d: [/D]
!LINE

PURPOSE

Connect a drive to a directory on another drive.

COMMENTS

The destination path must be empty and only one level deep from the root.
If the named directory doesn't exist, MS-DOS creates it automatically.

The only JOIN option is:

    /D  Disconnect a join.

See also 3ASSIGN and 84SUBST.
!PAGE
EXAMPLE

Assign everything in drive A to C:\ADISK:

    c:\> assign a: c:\adisk

Undo the join:

    c:\> join a: /d
!TOPIC 51 KEYSTACK
SYNTAX        (Internal 4DOS)

KEYSTACK ["abc"] [nn] [@nn]

PURPOSE

Feed keystrokes to a program from a batch file or alias.

COMMENTS

Characters entered within double quotes ("abc") will be stored "as is" in
the keyboard bufer.  Numbers (nn) not enclosed in quotes are ASCII decimal
codes (e.g., 13 (Enter), or 27 (ESCAPE)).  The number 0 is a special case;
it is used with programs that flush the keyboard buffer (it tells the
program the buffer is clear, so subsequent keystrokes will be accepted
normally).  Numbers preceded by @ are extended keyboard codes generated by
the Alt key, cursor pad keys, and the Function keys (e.g., @59 is the F1
function key).

You can store a maximum of 255 characters.

Each time KEYSTACK is executed, it will clear any remaining keystrokes
stored by a previous KEYSTACK.

You may need to experiment a bit with your programs to find the proper
sequence of keystrokes.  Programs that bypass MS-DOS and the BIOS for
keyboard input cannot read keystrokes entered with KEYSTACK.

KEYSTACK requires the device driver KEYSTACK.SYS be loaded in the
CONFIG.SYS file.

The following table lists the common key codes:

    F1  @59   Alt-F1  @104   Ctl-F1  @94    Shift-F1  @84
    F2  @60   Alt-F2  @105   Ctl-F2  @95    Shift-F2  @85
    F3  @61   Alt-F3  @106   Ctl-F3  @96    Shift-F3  @86
    F4  @62   Alt-F4  @107   Ctl-F4  @97    Shift-F4  @87
    F5  @63   Alt-F5  @108   Ctl-F5  @98    Shift-F5  @88
    F6  @64   Alt-F6  @109   Ctl-F6  @99    Shift-F6  @89
    F7  @65   Alt-F7  @110   Ctl-F7  @100   Shift-F7  @90
    F8  @66   Alt-F8  @111   Ctl-F8  @101   Shift-F8  @91
    F9  @67   Alt-F9  @112   Ctl-F9  @102   Shift-F9  @92
   F10  @68  Alt-F10  @113  Ctl-F10  @103  Shift-F10  @93
!PAGE
    Home  @71     Up  @72      PgUp  @73
    Left  @75                  Right  @77
    End   @79     Down  @80    PgDn  @81
    Ins   @82     Del  @83

    Ctl-Home  @119            Ctl-PgUp  @132
    Ctl-Left  @115            Ctl-Right  @116
    Ctl-End  @117             Ctl-PgDn  @118

    Alt-A  @30   Alt-N  @49   Alt-1  @120
    Alt-B  @48   Alt-O  @24   Alt-2  @121
    Alt-C  @46   Alt-P  @25   Alt-3  @122
    Alt-D  @32   Alt-Q  @16   Alt-4  @123
    Alt-E  @18   Alt-R  @19   Alt-5  @124
    Alt-F  @33   Alt-S  @31   Alt-6  @125
    Alt-G  @34   Alt-T  @20   Alt-7  @126
    Alt-H  @35   Alt-U  @22   Alt-8  @127
    Alt-I  @23   Alt-V  @47   Alt-9  @128
    Alt-J  @36   Alt-W  @17   Alt-0  @129
    Alt-K  @37   Alt-X  @45
    Alt-L  @38   Alt-Y  @21
    Alt-M  @50   Alt-Z  @44
!PAGE
EXAMPLE

The following batch file starts Lotus 1-2-3 and loads the file specified
on the command line:

    pushd c:\123
    keystack 0 13 0 13 0 13 0 13 0 13 "/fr" 0 "%1" 13
    123
    popd

The same command defined as an alias (enter this on one line):

    alias 321 `pushd c:\123 ^ keystack 0 13 0 13 0 13 0 13 0 13 "/fr"
        0 "%1" 13 ^ 123 ^ popd`
!TOPIC 52 LABEL
SYNTAX        (External MS-DOS)

LABEL [d:][volume label]

PURPOSE

Create, change, or delete a volume label.

COMMENTS

A volume label can contain up to 11 characters.  Do not use the MS-DOS
wildcard characters (* and ?) or any character from the following list:

    " + ; ' = [ , ] \ . | < >

MS-DOS will convert lowercase letters to uppercase.

If you omit the drive, MS-DOS will assume the default drive.

See also 27DISKCOPY and 97VOL.
!PAGE
EXAMPLE

Label the disk in drive A as BACKUP_88:

    c:\> label a:backup_88
!TOPIC 53 LIST
SYNTAX        (Internal 4DOS)

LIST [/SW] [d:][path]filename ...

PURPOSE

Display a file with forward and backward paging and scrolling.

COMMENTS

LIST provides a much faster and more flexible way to view a file than TYPE,
without the overhead of using a text editor.

The LIST options are:

    /S  Read from the standard input rather than a file.  This allows you
        to redirect command output and view it with LIST.
    /W  Wrap the text at the right margin.  This option is useful when
        displaying non-text files.

LIST uses the cursor pad to scroll through the file.  The following keys
have special meanings (the caret ^ means press the Ctrl key together with
the specified key):

    HOME           Display the first page of the file
    END            Display the last page of the file
    Esc            Exit the current file
    ^C             Quit LIST
    Up Arrow       Scroll up one line
    Down Arrow     Scroll down one line
    Left Arrow     Scroll left 8 columns
    Right Arrow    Scroll right 8 columns
    ^Left Arrow    Scroll left 40 columns
    ^Right Arrow   Scroll right 40 columns
    F1             Call the on-line help (HELP.EXE)
    F5             Prompt and search for a string (case is ignored)
    F6             Find next matching string (case is ignored).  LIST saves
                   the search string, so you can LIST multiple files and
                   search for the same string by pressing F6 in each file.
    F7             Print the file on LPT1

LIST is normally only useful for displaying ASCII text files; executable
files (.COM and .EXE) and many data files will be unreadable due to the
presence of non-alphanumeric characters.

See also 92TYPE.

EXAMPLE

Display the file MEMO.DOC:

    c:\> list memo.doc

Display the output from a DIR command:

    c:\> dir | list /s
!TOPIC 54 LOG
SYNTAX        (Internal 4DOS)

LOG [/W [d:]pathname | ON | OFF | "text"]

PURPOSE

Save a log of commands to a disk file.

COMMENTS

LOG defaults to saving to the file 4DOSLOG in the root directory of the
boot drive.

Entering LOG with no parameters displays the log status (ON or OFF).
Entering LOG with text writes the text to the log file, even if LOG is
set OFF.  This allows you to enter headers in the log file.

You can specify a different filename with the /W(rite) option.  /W
automatically enables command logging.

The commands are stored in the log file as they were entered, before
performing any alias or variable expansion.

The LOG file format looks like:

    [mm/dd/yy  hh:mm:ss] command

EXAMPLE

Display the LOG status:

    c:\> log
    LOG is OFF

Enable command logging:

    c:\> log on

Enable command logging to the file C:\LOG\LOGFILE and insert a header:

    c:\> log /w c:\log\logfile
    c:\> log "Started work on the database system"
!TOPIC 55 MD
SYNTAX        (Internal 4DOS)

MD [d:]pathname...
       or
!LINE
MKDIR [d:]pathname...

PURPOSE

Create subdirectories.

COMMENTS

To start at the root directory, start the pathname with a backslash (\).
To start at the parent directory, start the pathname with two periods (..).
All other pathnames start at the current directory.

The longest allowable path in MS-DOS from the root directory to any
subdirectory is 64 characters (including backslashes).

See also 68RD.
!PAGE
EXAMPLE

Create a subdirectory called MYDIR in the root directory:

    c:\> md \mydir
!TOPIC 56 MEMORY
SYNTAX        (Internal 4DOS)

MEMORY

PURPOSE

Display the system RAM status.

COMMENTS

MEMORY displays the total RAM, the free RAM (available to applications
programs after loading MS-DOS, device drivers, 4DOS itself, and RAM
resident programs); the total and free expanded memory; extended memory
(on an 80286 or 80386), the total and free environment space, the total
and free alias list space, and the total command history space.

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.
!PAGE
EXAMPLE

Display your RAM totals:

    c:\> memory
!TOPIC 57 MKDIR

See 55MD.
!TOPIC 58 MODE
SYNTAX        (External MS-DOS)

See below

PURPOSE

Setup a printer, video display, or serial ports.

COMMENTS

To set the printer parameters:

    MODE LPT#[:][n][,[m][,p]]
      #  1, 2, or 3  (the printer number)
      n  80 or 132 characters per line
      m  6 or 8 lines per inch
      P  Continuous retry on time-out errors

To set the video display parameters:

    MODE n
    MODE [n],m[,T]
      n  40, 80, BW40, BW80, CO40, CO80, or MONO
      m  R or L  (shift the display right or left)
      T  Display an alignment test pattern.

To set the serial port parameters:

    MODE COMn:baud[,parity][,databits[,stopbits[,P]]]
      n  1 or 2 (serial port number)
      P  Continuous retry on time-out errors

To redirect the parallel port output:

    MODE LPT#:=COMn
      #  1, 2, or 3  (the printer number)
      n  1 or 2 (serial port number)
!TOPIC 59 MORE
SYNTAX        (External MS-DOS)

MORE

PURPOSE

Display a screen-full of data, then pause.

COMMENTS

Pressing any key sends another screen of data to the standard output
device.  This continues until all input data has been read.

You can usually use LIST, or TYPE with the /P option rather than MORE.

See also 53LIST and 92TYPE.
!TOPIC 60 MOVE
SYNTAX        (Internal 4DOS)

MOVE [/PQR] [d:][path]filename ... [d:][path]filename

PURPOSE

Move files to other directories and drives.

COMMENTS

The MOVE command moves the specified file(s) to the last filename
specified, which is designated as the target.  If the target already
exists, it is deleted when the file is moved.  You cannot move a file
to itself.

If there is more than one source file specification, the target must be a
directory, and the files are moved to the directory with their original
filenames.  If the target is not a directory, MOVE will display an error
message and exit.

Use caution when using MOVE commands with commands like SELECT.  If
multiple files are selected and the target is not a subdirectory, each
file will be moved in turn to the target, overwriting the previous file.
The net result is that all files but the last will be deleted.  If SELECT
is invoked using square brackets instead of parentheses, the MOVE will be
done in a single command and MOVE will detect the error.

The MOVE options are:

    /P  Prompt for a Y or N response to confirm each move.
    /Q  Don't display files as they are moved.
    /R  Prompt for a Y or N response before overwriting an existing file.

MOVE first attempts to rename the file(s).  If that fails (the target is
on a different drive, or the target already exists), MOVE will copy the
file(s) and then delete the originals.  If MOVE cannot delete the original
(for example, a read-only file), it will display an error message, but the
target file is still created.

See also 18COPY and 70REN.
!PAGE
EXAMPLE

Move some files to a different directory:

    c:\> move *.wks *.txt c:\finance\myfiles

Move all the files in the current directory to A:\, prompting before
overwriting any existing files:

    c:\> move /r *.* a:\
!TOPIC 61 PATH
SYNTAX        (Internal 4DOS)

PATH [[d:]path][[;[d:]path]...]]

PURPOSE

Tells 4DOS where to search for executable and batch files not in the
current directory.

COMMENTS

When searching for an external command (.COM, .EXE, .BTM, and .BAT), 4DOS
searches the current directory first, then the directories you specify in
the order you list them.  The directory names are separated by semicolons
(;).  Like COMMAND.COM, 4DOS shifts the entire path to upper case before
storing it in the environment.  This maintains compatibility with programs
which can only recognize an upper case path.

If you enter PATH with no parameters, 4DOS displays the current search
path.  If you enter PATH and a semicolon, 4DOS clears the search path and
will search only the current directory (this is the default at system
startup).

If you specify an invalid directory, 4DOS will skip that directory and
continue searching with the next directory in the path.

Some applications also use the PATH variable to search for their files.

You can edit an existing path with the 34ESET command.

EXAMPLE

The following PATH command directs 4DOS to search for an executable file
in the following order: the current directory, the root directory on C,
the DOS subdirectory on C, and the UTIL subdirectory on C:

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

Display the current search path:

    c:\> path
!TOPIC 62 PAUSE
SYNTAX        (Internal 4DOS)

PAUSE [message]

PURPOSE

Suspend alias or batch file execution.

COMMENTS

A PAUSE command will suspend execution, giving you the opportunity to
perform activities such as changing disks, turning on the printer, etc.

PAUSE flushes the keyboard buffer and waits for any key (except ^C or
^BREAK) to be pressed and then continues executing.  If a prompt message
is specified, 4DOS will display the message and wait for a keystroke.
Otherwise, PAUSE will prompt:

     Press a key when ready...

If you press a ^C or ^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 prompted whether to cancel the batch file.

See also 48INKEY and 49INPUT.

EXAMPLE

The following batch file fragment prompts the user before erasing files:

     pause ^C aborts, any other key erases the .LST files:
     erase *.lst
!TOPIC 63 POPD
SYNTAX        (Internal 4DOS)

POPD [*]

PURPOSE

Change to the disk drive and directory at the top of the directory stack.

COMMENTS

POPD restores the disk and directory saved using PUSHD (most recent first).

The * option clears the directory stack, without changing the current drive
and directory.

Use the DIRS command to display the directory stack.

See also 25DIRS and 66PUSHD.
!PAGE
EXAMPLE

Save and change your disk drive with PUSHD, and then restore it:

    c:\> pushd d:\database\test
    d:\database\test> popd
    c:\>

Clear the directory stack:

    c:\> popd *
!TOPIC 64 PRINT
SYNTAX        (External MS-DOS)

PRINT [/D:device][/B:bufsiz][/U:busytick]
      [/M:maxtick][/S:timeslice][/Q:quesiz]
      [/T][/C][/P] ...][[d:][path][filename][.ext]...]

PURPOSE

Queue and print data files.

COMMENTS

The PRINT options are:

    /D  Specify the print device.  Defaults to PRN.
    /B  Set the size of the internal buffer.
    /Q  Specify the maximum number of files in the print queue (1 - 32).
    /S  Specify the time-slice value (1 - 255).
    /U  Specify the number of clock ticks to wait for the printer.
    /M  Specify how many clock ticks PRINT can have (1 - 255).
    /T  Stop printing and delete all files from the queue.
    /C  The preceding filename, and all following filenames until the end
        of the line or a /P is found are deleted from the print queue.
    /P  Print the preceding filename and all following filenames until
        the end of the line or a /C is found.

EXAMPLE

Set the print device to LPT2, set the buffer to 4K, and the maximum queue
size to 10:

    c:\> print /D:lpt2 /B:4096 /Q:10
!TOPIC 65 PROMPT
SYNTAX        (Internal 4DOS)

PROMPT [text]

PURPOSE

Change the 4DOS command line prompt.

COMMENTS

If you enter PROMPT with no parameters, 4DOS sets the prompt on drives A
and B to $n$g, and on all other drives to $p$g (display current disk
and directory).

The prompt text can contain special strings of the form $?, where ? is one
of the following:

    b  The | character
    c  The open parenthesis (
    d  Current date, in the format:  Sun Jan 1, 1989
    e  The ASCII ESC character (decimal 27)
    f  The close parenthesis )
    g  The > character
    h  BACKSPACE over the previous character.
    l  The < character
    n  Default drive letter
    P  Current disk and directory (upper case)
    p  Current disk and directory (lower case)
    q  The = character
    s  The space character
    t  Current time, in the format hh:mm:ss
    v  MS-DOS version number, in the format:  3.31
    Xd:  Current disk and directory (upper case) where d: is the
       drive specification
    xd:  Current disk and directory (lower case) where d: is the
       drive specification
    z  Display the current 4DOS shell nesting level (you must be running
       4DOS as the primary shell in swapping mode).  The primary command
       processor is 0.  Resident copies of 4DOS return a 99 for the shell
       nesting level.
    $  The $ character
    _  CR/LF (go to beginning of new line)

Under COMMAND.COM, it is possible to use the PROMPT command in a batch file
to transmit ANSI control sequences to the screen (for example, to redefine
function keys).  This is because COMMAND.COM displays a prompt when echoing
lines in a batch file.  This technique will not work with 4DOS, because
4DOS doesn'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, use the ECHO command, substituting e (Ctrl-X followed by an e) for
$e in the PROMPT string.

EXAMPLE

Set the prompt to the current date and time:

    c:\> prompt $d $t $g
    Mon Dec 25, 1989 18:29:19 >
!TOPIC 66 PUSHD
SYNTAX        (Internal 4DOS)

PUSHD [[d:]pathname]

PURPOSE

Save the current disk and directory.

COMMENTS

PUSHD saves the current directory on the directory stack, and if a pathname
is specified on the command line, changes the disk drive and directory.  If
The directory stack can hold up to 255 characters (about 10 to 20 entries).
If you exceed the directory stack size, the oldest directory is removed
before adding the current directory.

The saved directory is restored on a "last in, first out" basis by the POPD
command.  The directory stack can be displayed with the DIRS command.

See also 12CDD, 25DIRS and 63POPD.
!PAGE
EXAMPLE

Save the current directory and change to C:\WORDP\MEMOS:

    c:\> pushd c:\wordp\memos
    c:\wordp\memos>
!TOPIC 67 QUIT
SYNTAX        (Internal 4DOS)

QUIT

PURPOSE

Terminate the current batch file.

COMMENTS

You can QUIT at any point in a batch file, not just the end.  If you QUIT
a batch file called from another batch file, you will be returned to the
previous file at the command following the original call.  To end all batch
file processing, use CANCEL.

See also 9CANCEL.

EXAMPLE

Check to see if the user entered "quit" and exit if true:

    input Enter your choice:  %%option
    if "%option" == "quit" quit
!TOPIC 68 RD
SYNTAX        (Internal 4DOS)

RD [d:]path ...
     or
RMDIR [d:]path ...

PURPOSE

Remove one or more directories.

COMMENTS

Before removing a subdirectory, you must delete all the files and
subdirectories (and their files) in that directory (including any hidden
or read-only files).

You can use the MS-DOS wildcard characters (* and ?) in the directory
names.

You cannot remove the root directory (\), the current directory (.), or
the parent directory (..).

See also 55MD.
!PAGE
EXAMPLE

Remove the subdirectory MEMOS from the subdirectory WP:

    c:\> rmdir \wp\memos
!TOPIC 69 REM
SYNTAX        (Internal 4DOS)

REM [comment]

PURPOSE

Put a comment in a batch file.

COMMENTS

If ECHO is ON, or the variable VERBOSE (see the SETDOS command) is set,
4DOS will echo the comment.  Otherwise, 4DOS will ignore it.  If you don't
want to echo the line, preface REM with the @ character.

Enter your comment following the REM, separated by a space or tab.
Comments can be up to 255 characters.  4DOS will ignore everything
following a REM, including quote characters, the redirection symbols
(|><) and the command separator character.

Batch file comments are useful for documenting the purpose for a batch
file and the procedures used.
!PAGE
EXAMPLE

Enter comments in a batch file:

     rem This batch file provides a menu-based system for accessing the
     rem word processing utilities.  Clear the screen and get a selection
     cls
!TOPIC 70 REN

SYNTAX        (Internal 4DOS)

REN [/PQ] [d:][path]filename ... [d:][path]filename
    or
!LINE
RENAME [/PQ] [d:][path]filename ... [d:][path]filename

PURPOSE

Rename files or subdirectories.

COMMENTS

The last filename is the new name; preceding names are the files or
directories to be renamed.  You can use the wildcard characters (* and ?)
in the filenames.  The new filename must not already exist.  You cannot
rename a subdirectory to a new path!

The REN options are:

    /P  Confirm each rename (Y or N).
    /Q  Don't display filenames as they are renamed.

RENAME in COMMAND.COM only allows a path to be specified with the first
file name; the path for the target is always the same as the source.  4DOS
allows you to optionally select the target path, renaming the source file
to a new directory on the same disk drive.  If you don't specify a path for
the target, 4DOS will assume a "COMMAND.COM compatible RENAME" and will
rename the source file to the new name without moving it to another
directory.

If you want to rename to a different drive, use MOVE.

See also 60MOVE.

EXAMPLE

Rename the file MEMO.TXT to OFFICE.TXT:

    c:\> rename memo.txt office.txt

Rename the directory \WORDPROC to \WP:

    c:\> rename \wordproc \wp
!TOPIC 71 RENAME

See 70REN.
!TOPIC 72 RESTORE
SYNTAX        (External MS-DOS)

RESTORE d: [d:][path][filename] [/S/P]

PURPOSE

Restore backup files to disk.

COMMENTS

The first argument is the source drive; the second is the target disk.
RESTORE will not restore existing system files.

The RESTORE options are:

    /S  Restore all subdirectory files in addition to the
        specified directory.
    /P  Prompt before restoring files that have changed since
        the last backup, or that are marked read-only.

See also 5BACKUP.
!PAGE
EXAMPLE

Restore the fixed disk C from the backup disks in A:

    c:\> restore a: c: /s

Restore the file \WP\MEMO.DOC from the backup disk in A:

    c:\> restore a: c:\wp\memo.doc
!TOPIC 73 RETURN
SYNTAX        (Internal 4DOS)

RETURN

PURPOSE

Return from a GOSUB (subroutine) call in a batch file.

COMMENTS

The RETURN command returns from a GOSUB call to the command following the
original GOSUB.

See also 42GOSUB.

EXAMPLE

The following batch file fragment calls a subroutine which displays the
current directory:

    echo Calling a subroutine
    gosub subr1
    echo Returned from the subroutine
    quit
    :subr1
    dir /hw
    return
!TOPIC 74 RMDIR

See 68RD.
!TOPIC 75 SCREEN
SYNTAX        (Internal 4DOS)

SCREEN row column [message]

PURPOSE

Position the cursor on the screen, and optionally display a message.

COMMENTS

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.

SCREEN allows you to create attractive batch file screen displays.

SCREEN does not change the screen colors.  If you have ANSI.SYS installed
and have set colors with CLS or COLOR, those colors will be used for the
display.  To display text in specific colors, use SCRPUT.

SCREEN checks for a valid row and column, and displays an error message if
either value is out of range.

See also 31ECHO, 76SCRPUT and 88TEXT.

EXAMPLE

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
!TOPIC 76 SCRPUT
SYNTAX        (Internal 4DOS)

SCRPUT row column [bright] [blink] fg ON bg text

PURPOSE

Display text in color.

COMMENTS

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 works like SCREEN, but allows you to specify the display colors, and
writes directoy to the screen.

The parameters are:

    row     Start row
    column  Start column
    fg      Foreground character color
    bg      Background character color

Only the first three characters of the color name and attributes ("bright"
and "blink") are required.  The available colors are:

    Black      Blue      Green      Red
    Magenta    Cyan      Yellow     White

See also 31ECHO, 75SCREEN and 88TEXT.

EXAMPLE

The following batch file fragment displays a menu in color:

    @echo off ^ cls white on blue
    scrput 3 10 bri white on blue Select a number from 1 to 4:
    scrput 6 20 bri red on blue 1 - Word Processing
    scrput 7 20 bri yellow on blue 2 - Spreadsheet
    scrput 8 20 bri green on blue 3 - Telecommunications
    scrput 9 20 bri magenta on blue 4 - Quit
!TOPIC 77 SELECT
SYNTAX        (Internal 4DOS)

SELECT [/Oeitzur] [command] ([d:][path]filename ...) ...

PURPOSE

Execute a command on the specified files.

COMMENTS

SELECT allows you to select command line file arguments by marking the
directories using a full-screen "point-and-shoot" display.  SELECT
substitutes the selected files for the argument enclosed in parentheses,
and executes the command for each marked file.  If you specify multiple
arguments in the parentheses, SELECT will display the matching files for
the first argument, prompt you to mark the files, execute the command for
each marked file, and then continue the same procedure with the next
argument.

If you enclose the arguments in square brackets [] rather than parentheses,
SELECT will insert all of the arguments into the command line and only
execute the command once.  You must be careful not to exceed the maximum
line length (127 characters for external commands, and 255 characters for
internal 4DOS commands).

SELECT uses the cursor up, cursor down, PgUp, and PgDn keys to scroll
through the files matching the argument(s).  Use the + key to select a
file, and the - key to unselect a file.  The * key will select all of the
files (excluding subdirectories).  After marking the files, press ENTER to
execute the command.  You can select a single file by moving the scroll bar
to the filename and pressing ENTER.

The SELECT options are:

    /O  Determine the sort order for the directory display (the default
        sort is by filename):
          e  Sort by extension
          i  Sort by description (see 23DESCRIBE)
          r  Reverse the normal sort order
          t  Sort by time (oldest first)
          u  Unsorted
          z  Sort by size

To cancel the SELECT command, type an Escape, ^C, or ^BREAK.
!PAGE
EXAMPLE

Select from the files in the current directory with the
extension .COM, and then from the files with the extension .EXE
to copy to the root directory on drive A:

    c:\> select copy (*.com *.exe) a:\
!TOPIC 78 SET
SYNTAX        (Internal 4DOS)

SET [/P][/R [d:][path]filename] [variable[=][value]]

PURPOSE

Display, create, modify, or delete environment variables.

COMMENTS

Entering SET with no variable or value displays the environment. If you
don't enter a value, SET will remove the variable from the environment.
Otherwise, the variable and value are placed in the environment.  If the
variable already exists, its old contents are replaced by the new value.
4DOS limits the variable name to a maximum of 80 characters, and the value
to a maximum of 255 characters.  The variable names are shifted to upper
case before being stored in the environment; the value is stored exactly
as entered.

The SET options are:

    /P  Pause after displaying a page of environment entries. Press ^C to
        quit, or any other key to display the next page.
    /R  Read environment variables from a file.  This is much faster than
        loading variables in a batch file.  The file is in the same format
        as the SET display, 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 add comments to a variable file by starting the comment
        line with a colon (:).

SET only affects the environment of the current command processor. If you
EXIT to a parent command processor, the original environment will be
unchanged.  The size of the environment is specified by the /E parameter
at startup.  The default size is 512 characters, the minimum size 256
characters, and the maximum size 32000 characters.

You can remove multiple environment variables with the UNSET command, and
edit environment variables with the ESET command.

See also 34ESET and 94UNSET.

EXAMPLE

Display the current environment:

    c:\> set

Add a variable to the environment:

    c:\> set mine=c:\finance\myfiles

Remove a variable from the environment:

    c:\> set mine
!TOPIC 79 SETDOS
SYNTAX        (Internal 4DOS)

SETDOS [/A? /C? /E? /H? /I+|-command /L? /M? /N? /R? /S?:? /U? /V?]

PURPOSE

Display or set 4DOS configuration variables.

COMMENTS

SETDOS allows you to customize 4DOS to your personal tastes.  You would
normally define the SETDOS variables in AUTOEXEC.BAT or 4START.BAT.

The SETDOS options are:

    A  The ANSI variable determines whether 4DOS will attempt to use an
       ANSI escape sequence for CLS.  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 whether an ANSI driver is installed; /A1
       forces 4DOS to assume an ANSI driver is installed.

    C  The COMPOUND variable is the character used for separating multiple
       commands on the same line.  The default character is the caret (^).
       You cannot use any of the redirection characters (|><), or the white-
       space characters (=,;) as the command separator.

    E  The ESCAPE variable is 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 line.  The
       default escape character is ^X (Ctrl-X).  You cannot use any of the
       redirection characters (|><) or the whitespace characters (=,;) as
       the escape character.

    H  The HISTORY variable determines the minimum command size to save.
       Any command line whose length is less than this value will not be
       saved to the history list.  Setting /H to 256 will disable history
       saves; setting it to 0 will save everything.  The default value is 0
       (save all command lines).

    I  The INTERNAL variable allows you to disable or enable internal 4DOS
       commands.  To disable a command, precede the command name with a
       minus (-).  To reenable a command, precede it with a plus (+).

    L  The LINE variable controls how 4DOS gets its input from the command
       line.  The default value is 0 (character input).  If you set /L to
       1, 4DOS uses the MS-DOS "Get Line" call (like COMMAND.COM). Note
       that this will disable command line editing, history recall, and
       filename expansion.  If you have a program that requires line input,
       you can define an alias or batch file:

           setdos /L1 ^ program %& ^ setdos /L0

       See the file COMPAT.DOC for information on programs which require
       this option.

    M  The MODE variable controls the line editing mode.  4DOS defaults
       to overstrike mode (/M0).  If MODE is set to 1, the default is
       insert mode.

    N  The NOCLOBBER variable controls output redirection.  If NOCLOBBER is
       set to 1, then existing files may not be destroyed by output
       redirection, and when appending with >>, the output file must exist.
       NOCLOBBER can be overridden with the ! character.  The default value
       is 0.

    R  The ROWS variable determines the number of screen rows used by the
       video display.  Normally 4DOS detects the screen size, but if you
       have a non-standard display you may need to set it explicitly.  The
       ROWS variable does not affect screen scrolling (that is controlled
       by your video BIOS or ANSI.SYS); it is used only for LIST, SELECT,
       the paged output options (i.e., TYPE /P), and error checking in the
       screen output commands.

    S  The SHAPE variable sets the 4DOS cursor shape.  The format is /Ss:e,
       where "s" is the starting scan line, and "e" the ending.  The
       default values are the last two lines of the cursor cell.  The
       default editing mode (see /M above) uses the default cursor shape;
       the other mode sets the starting scan line to 0 and displays a block
       cursor.

    U  The UPPER variable controls the way filenames are displayed for the
       internal commands (COPY, DIR, etc.).  If UPPER is 1, filenames will
       be displayed in upper case (like COMMAND.COM).  Upper defaults to
       /U0 (filenames will be displayed in lower case).

    V  The VERBOSE variable controls command echoing in batch files.  If
       VERBOSE is set to 0, batch files will NOT be echoed unless ECHO is
       set ON.  VERBOSE defaults to 1 (batch file commands WILL be echoed).
!PAGE
EXAMPLE

Change the COMPOUND character to a ~ (tilde):

    c:\> setdos /c~

Change MODE to insert, VERBOSE to off, and set NOCLOBBER on:

    c:\> setdos /m1 /v0 /n1

Disable the internal LIST command to force 4DOS to use an external command:

    c:\> setdos /i-list
!TOPIC 80 SETLOCAL
SYNTAX        (Internal 4DOS)

SETLOCAL

PURPOSE

Save a copy of the current disk drive, directory, environment variables,
and aliases.

COMMENTS

SETLOCAL is used in batch files to save the disk drive, directory, aliases,
and environment variables to a reserved block of memory.  You can then
change their values, and later restore the original values with ENDLOCAL.
You cannot use SETLOCAL in an alias.

SETLOCAL and ENDLOCAL are not nestable within the same batch file.
However, you can have multiple SETLOCAL / ENDLOCAL pairs within a batch
file, and nested batch files can each have their own SETLOCAL / ENDLOCAL.
4DOS will automatically perform an ENDLOCAL at the end of a batch file.

Note that if you invoke a batch from another without using CALL, the first
batch file is implicitly terminated, and an automatic ENDLOCAL performed.
The second batch file will inherit the drive, directory, environment
variables, and aliases as they were prior to the SETLOCAL.

Do not use TSRs (memory-resident programs) 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 harmful, but wastes memory.

See also 32ENDLOCAL.

EXAMPLE

This batch file fragment saves the disk drive, directory, aliases, and
environment variables, changes the disk and directory, modifies some
variables, runs a program, and then restores the original values:

    setlocal
    cdd d:\test ^ set path=c:\;c:\dos;c:\util ^ set lib=d:\lib
    rem run some program here
    endlocal
!TOPIC 81 SHARE
SYNTAX        (External MS-DOS)

SHARE [/F:filespace][/L:locks]

PURPOSE

Load support for file sharing and file locking.

COMMENTS

SHARE is for network users.  To install shared files, put SHARE in your
AUTOEXEC.BAT file.

The SHARE options are:

    /F:filespace - allocate file space for the file sharing information
       area.  Each open file requires the length of the full filename plus
       11 bytes.  The default value is 2048 bytes.
    /L:locks - allocate space for the number of locks.  The default value
       is 20 locks.
!PAGE
EXAMPLE

Allocate 4096 bytes for file space and 40 locks:

    c:\> share /F:4096 /L:40
!TOPIC 82 SHIFT
SYNTAX        (Internal 4DOS)

SHIFT [n]

PURPOSE

Allow the use of more than 10 variables in a batch file.

COMMENT

SHIFT is provided for compatibility with COMMAND.COM. COMMAND.COM supports
only 10 parameters (%0 through %9); 4DOS supports 128 parameters (%0 to
%127), so you may not need to use SHIFT for batch files running exclusively
under 4DOS.

SHIFT moves each of the batch file parameters "n" positions (i.e., %1
becomes %0, %2 becomes %1, etc.).  The default value for "n" is 1.  You can
also reverse a SHIFT, by giving a negative value for "n" (i.e., if "n" is
-1, the former value for %0 is restored, %1 becomes %1, %1 becomes %2, etc.).

SHIFT also affects the %& (command line tail) and %# (number of command
arguments) batch variables.

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 zero one two three four five six
       zero one two three
       one two three four
       three four five six
       two three four five
!TOPIC 83 SORT
SYNTAX        (External MS-DOS)

SORT [/R][/+n]

PURPOSE

Read data from standard input, sort it, and write it to standard output.

COMMENTS

SORT is a filter used to organize information.  The largest file you can
sort is 63K.  SORT ignores case differences.

The SORT options are:

    /R   Sort in reverse order (Z - A).
    /+n  Start sorting with column n.

EXAMPLE

Sort the file ADDRESS and write it to SORTED:

    c:\> sort < address > sorted
!TOPIC 84 SUBST
SYNTAX        (External MS-DOS)

SUBST
!LINE
SUBST d: d:path
!LINE
SUBST d: /D

PURPOSE

Substitute a virtual drive for a pathname.

COMMENTS

If you don't enter any arguments, SUBST will display the current virtual
drives.

The only option for SUBST is:

    /D  Delete a substitution

See also 3ASSIGN and 50JOIN.
!PAGE
EXAMPLE

Create a virtual drive D to access C:\WP\MEMOS\JAN89:

    c:\> subst d: c:\wp\memos\jan89
!TOPIC 85 SWAPPING
SYNTAX        (Internal 4DOS)

SWAPPING [on | off]

PURPOSE

Display, enable, or disable the 4DOS swapping state.

COMMENTS

SWAPPING will temporarily disable or enable the swapping of the 4DOS
transient portion to EMS, XMS, or disk.  This is particularly useful when
running batch files while swapping to disk.  If swapping is enabled, 4DOS
saves its transient portion before executing any external command.  When
the command finishes, 4DOS performs a checksum on the transient portion,
and restores it if necessary.  (When swapping to EMS or XMS, 4DOS always
restores the transient portion.)  When you are running several small
programs from a batch file and using disk swapping, the swapping can
sometimes cause a noticeable delay.  Turning SWAPPING OFF can speed up
such operations, particularly in a length AUTOEXEC.BAT file.

If SWAPPING is OFF, available MS-DOS memory will be reduced by the size
of the 4DOS transient portion (about 70K).  Setting SWAPPING OFF does not
close the disk swap file, or release any reserved EMS or XMS memory.

EXAMPLE

Check the current SWAPPING status:

    c:\> swapping
    SWAPPING is ON

The following batch file fragment disables swapping, runs several programs,
and then reenables swapping:

    swapping off
    c:\util\mouse
    c:\video\ansi.com
    cls bright white on blue
    c:\bin\cache.com
    swapping on
!TOPIC 86 SYS
SYNTAX        (External MS-DOS)

SYS d:

PURPOSE

Copy the two hidden operating system files to another drive.

COMMENTS

Not all versions of SYS will transfer COMMAND.COM.  The target disk must
be formatted and blank, or be a bootable MS-DOS disk.

See also 39FORMAT.

EXAMPLE

Copy the system files to drive A:

    c:\> sys a:
!TOPIC 87 TEE
SYNTAX        (Internal 4DOS)

TEE [/A] [d:][path]filename ...

PURPOSE

Copy standard input to standard output, and save a copy in the specified
file(s).

COMMENTS

The only option for TEE is:

    /A  Append output to the file(s) rather than overwriting it.

If you are typing at the keyboard, you need to enter a ^Z to terminate the
input.

TEE is often used to save the intermediate output of a pipe.

See also 99Y.
!PAGE
EXAMPLE

Search the file DOC for any lines containing the string "4DOS", make a copy
of the matching lines in 4.DAT, and write them to the output file 4DOS.DAT:

    c:\> find "4DOS" doc | tee 4.dat | sort > 4dos.dat
!TOPIC 88 TEXT
SYNTAX        (Internal 4DOS)

TEXT
  .
  .
  .
!LINE
ENDTEXT

PURPOSE

Display a block of text in a batch file.

COMMENTS

The TEXT command is useful for displaying menus or multiple-line messages.
TEXT will display subsequent lines in the text until terminated by ENDTEXT.
Both TEXT and ENDTEXT must be entered as the only command on that line.

If you have ANSI.SYS loaded, you can change screen colors by inserting ANSI
escape sequences into the text block.

See also 31ECHO, 75SCREEN, and 76SCRPUT.

EXAMPLE

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

     Enter your selection:
     endtext
!TOPIC 89 TIME
SYNTAX        (Internal 4DOS)

TIME [hh:mm:ss]

PURPOSE

Display or set the current system time.

COMMENTS

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.

The parameters for the TIME command are:

     hh (hour)   = 0 - 23
     mm (minute) = 0 - 59
     ss (second) = 0 - 59

TIME defaults to 24-hour format, but you can optionally enter the time in
12-hour format by appending an "am" or "pm".

Whenever you create or modify a file, the system time is recorded in the
directory entry.

See also 13CHCP and 20DATE.

EXAMPLE

Enter the time (9:30 am):

    c:\> time 9:30

To be prompted for the time:

    c:\> time
    Mon Dec 25, 1989  9:30:10
    New time (hh:mm:ss):
!TOPIC 90 TIMER
SYNTAX        (Internal 4DOS)

TIMER [/S]

PURPOSE

System stopwatch.

COMMENTS

The TIMER command turns the system stopwatch on and off.  The first time
you run TIMER, the stopwatch starts.  When you run TIMER again, the
stopwatch stops and the elapsed time is displayed.

The only option for TIMER is:

    /S  Display split times without stopping the timer.

TIMER is particularly useful for timing events in batch files.

The smallest interval TIMER can measure 0.06 seconds; the largest interval
is 23:59:59.99.

See also 89TIME.

EXAMPLE

Start the timer:

    c:\> timer
    Timer on:  12:21:46

Display a split time:

    c:\> timer /s
    Elapsed time:  0:00:06.19

Stop the timer:

    c:\> timer
    Timer off:  12:21:58   Elapsed time 0:00:12.06
!TOPIC 91 TREE
SYNTAX        (External MS-DOS)

TREE [d:][/F]

PURPOSE

Display the directory and file structure.

COMMENTS

The only option for TREE is:

    /F - Display the names and specifications of all files on the disk.

See also 24DIR.

EXAMPLE

Display the names of the files in all directories on the current drive:

    c:\> tree \ /f
!TOPIC 92 TYPE
SYNTAX        (Internal 4DOS)

TYPE [/LP] [d:][pathname]filename...

PURPOSE

Display the contents of the specified file(s).

COMMENTS

The TYPE command displays a file.  Press ^S to suspend the display, and
any character key to continue the display.

The TYPE options are:

    /L  Print line numbers preceding each line of text.
    /P  Pause after each page.  Press ^C to quit, or any other key to
        display the next page.

TYPE is normally only useful for displaying ASCII text files; executable
files (.COM and .EXE) and many data files will be unreadable due to the
presence of non-alphanumeric characters.

You will probably find LIST to be more useful for displaying files.

See also 53LIST.

EXAMPLE

Display the files MEMO1 and MEMO2, pausing at the end of each page:

    c:\> type /p memo1 memo2
!TOPIC 93 UNALIAS
SYNTAX        (Internal 4DOS)

UNALIAS alias...
     or
!LINE
UNALIAS *

PURPOSE

Remove aliases from the alias list.

COMMENTS

UNALIAS also accepts the wildcard character * to delete all aliases.

See also 2ALIAS and 34ESET.

EXAMPLE

Remove the alias DDIR:

    c:\> unalias ddir
!PAGE
Remove the aliases DDIR and ZAP:

    c:\> unalias ddir zap

Remove all the aliases:

    c:\> unalias *
!TOPIC 94 UNSET
SYNTAX        (Internal 4DOS)

UNSET name...
     or
!LINE
UNSET *

PURPOSE

Remove variables from the environment.

COMMENTS

UNSET also accepts the wildcard character * to delete all environment
variables.  Use caution with UNSET *; many programs are dependent on
environment variables, and 4DOS itself relies on PATH, COMSPEC, and
4DSHELL.

See also 78SET and 34ESET.

EXAMPLE

Remove the variable CMDLINE:

    c:\> unset cmdline

Remove the variables CMDLINE and PATH:

    c:\> unset cmdline path

Remove all the environment variables:

    c:\> unalias *
!TOPIC 95 VER
SYNTAX        (Internal 4DOS)

VER

PURPOSE

Display the current 4DOS and MS-DOS versions.

COMMENTS

The 4DOS and MS-DOS versions consist of a one digit major version number,
a period, and a two digit minor version number.

EXAMPLE

Get the current version of 4DOS and MS-DOS:

    c:\> ver
    4DOS 3.0  DOS 3.31
!TOPIC 96 VERIFY
SYNTAX        (Internal 4DOS)

VERIFY [on | off]

PURPOSE

Display, enable, or disable disk write verification.

COMMENTS

When VERIFY is ON, MS-DOS will verify that no error occurred during each
disk write operation.  It does NOT compare the data actually written to
the disk.  VERIFY will remain ON until you set it OFF.

Entering VERIFY with no parameters will display the current VERIFY state.

Verification will slow your disk write operations slightly.

At system startup, VERIFY is OFF.
!PAGE
EXAMPLE

Check the current verify status:

    c:\> verify
    VERIFY is OFF

Enable disk write verification:

    c:\> verify on
!TOPIC 97 VOL
SYNTAX        (Internal 4DOS)

VOL [d:] ...

PURPOSE

Display the disk volume label(s).

COMMENTS

If you don't enter a drive name, VOL displays the disk label for the
current drive.

If the disk doesn't have a volume name, VOL will report it as "unlabeled."

Volume labels can be created, changed or deleted with the MS-DOS LABEL
command.

See also 27DISKCOPY and 52LABEL.
!PAGE
EXAMPLE

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
!TOPIC 98 XCOPY
SYNTAX        (External MS-DOS)

XCOPY [d:][path]filename [d:][path]filename [/A/D/E/M/P/S/V/W]

PURPOSE

Copy files and directories, including subdirectories.

COMMENTS

The first argument is the source file or directory you want to copy.  The
second argument is the target.  If you omit the target, XCOPY uses the
default directory with the default filename *.*.

The XCOPY options are:

    /A  Copy source files that have the archive bit set.  This option
        does not modify the archive bit.
    /D  Copy source files modified on or after the specified date, in
        the format: /D:mm/dd/yy.
    /E  Copy any subdirectories, even if they are empty.  You must use
        /S with this option.
    /M  Same as /A, but after copying a file, turn off the archive bit
        in the source file.
    /P  Prompt with a "Y/N" before creating each target file.
    /S  Copy subdirectories, unless they are empty.
    /V  Verify each file as it is written.
    /W  Wait for a keystroke before copying files.

See Also 5BACKUP, 18COPY, and 60MOVE.

EXAMPLE

Copy all of the files from drive D to drive C:

    c:\> xcopy d:\ c:\ /s

Copy all of the files in the WP directory on drive C that were modified on
or after January 1, 1989 to drive A:

    c:\> xcopy c:\wp a:\ /d:1-1-89
!TOPIC 99 Y
SYNTAX        (Internal 4DOS)

Y [d:][path]filename ...

PURPOSE

Copy standard input to standard output, and then copy the specified file(s)
to standard output.

COMMENTS

Standard input from the console is terminated by a ^Z.

See also 87TEE.

EXAMPLE

Get text from standard input, append the files MEMO1 and MEMO2 to it, and
send the output to MEMOS:

    c:\> y memo1 memo2 > memos
