The following is an appendix to the FreeDOS Spec This section addresses the DOS commands behavior and usage.

FreeDOS Spec

Appendix, Commands Behavior

DOS commands may be internal or external. Any DOS command may be implemented internally by the shell, or provided externally as in a program. If external, the program may be either a COM or EXE, with the exception of COMMAND.COM.

In each of the following, d: represents a drive letter, path represents a full pathname, and file represents a full filename, or a file mask including * and ?.

For all commands, internal and external, the command line option /? should generate a help screen, and the program should immediately exit. The exit code is not defined, but we strongly suggest an exit code of zero.

A few traditional MS-DOS commands have been dropped from the Spec. Dropping from the Spec does not mean that such a program will be ignored if one ever comes along, but this does mean that we will not actively seek out to develop a new version. This is because they were considered as part of a legacy migration thing for MS-DOS, which the FreeDOS Project is not interested in carrying forward. Where a program has been dropped from the Spec, an annotation has been made to explain why.


append
Allows programs to open data files in the specified directories as though they were local to the working directory.

[Dropped, because the program was considered to be a "crutch" for legacy DOS-based applications as DOS moved to support directories. Append was used primarily to support programs that did not know about directories on a DOS system.]

  append [[d:]path[;...]] [options]

Options:
  ;
  When used by itself, the semicolon cancels the previously specified
  appended directories.

  /x[:on|:off]
  Allows the shell (if supported) to search these directories as though
  they were in the PATH.  Default is /x:off.  /x is the same as /x:on.

  /path:{on|off}
  Specifies if DOS is to search appended directories for a program's
  data file, even if the program specifies a full path.  Default is
  /path:on.

  /e
  Add the list of appended directories to the PATH.

  If no paths are named, display the current appended directories.

assign
Reassigns disk operations from one drive to another. For example, to reassign disk operations for drive A: to drive B:.

  assign [d:=d:] [...]
  assign /status

Options:
  /status
  Displays the current assignments.

  If no drives are named, display the current assignments.

attrib
Change a file's attributes.

  attrib [options] [[d:][path]file]

Options:
  +r | -r
  Sets the read-only attribute.  -r will clear it.

  +a | -a
  Sets the archive attribute.  -a will clear it.

  +s | -s
  Sets the system attribute.  -s will clear it.

  +h | -h
  Sets the hidden attribute.  -h will clear it.

  /s
  Act on subdirectories, too.

  If no file is named, display the attributes for all files in the
  current directory.

break
Sets or clears the Break or Ctl-C check.

  break [on|off]

Options:
  on | off
  Turn on (or off) the Break check.

  If no arguments are named, display the current Break check status.

cd, chdir
Displays the name of the current directory, or changes to another one.

  cd [d:][path]
  chdir [d:][path]

chcp
Change the DOS code page.

  chcp [nnn]

Options:
  nnn
  The code page that is to be loaded.  Use 437=US, 850=Multi (Latin
  I), 852=Slavic (Latin II), 860=Portuguese, 863=Canadian-French,
  865=Nordic.

  If no code page is named, display the current code page.

chkdsk
Check the disk for errors.

  chkdsk [d:] [options]

Options:
  /f
  Fix errors on the disk when found.

  /v
  Display the name of every file as the disk is checked.

  If no drive is specified, check the current disk for errors.

cls
Clear the screen.

  cls

choice
Suspend processing, and wait for the user to press a valid key.

  choice [options] [text]

Options:
  /C[:]choices
  Specifies allowable keys. Default is YN

  /N
  Do not display choices and ? at end of prompt.

  /S
  Treat choices as case sensitive.

  /T[:]c,nn
  Specify the default choice `c' after `nn' seconds of no response.

  text
  Prompt string to display (Default=none.)

command
Start a new command shell.

  command [[d:]path] [device] [options]

Options:
  d:path
  The drive and path where the shell is to look for the transient part
  of the program.  This is usually only needed to set the COMSPEC.

  device
  An alternate device for all i/o.

  /e:nnnnn
  The environment size, in bytes, in the range 160-32768.  This number
  will be rounded up the nearest 16 bytes.  The default is 256.

  /p
  Make the shell permanent, so the EXIT command does not exit the
  shell.

  /c {string}
  Execute the command in {string}, then exit.

  /msg
  Load any error messages that might be stored on disk into memory.

comp
Compare two files.

  comp [d:][path]file [d:][path]file [options]

Options:
  /d
  Display differences in decimal format.  Default is hex.

  /a
  Display differences using characters.

  /L
  Display the line number on which the difference occurred.

  /n=nnn
  Compares the first nnn lines of both files, even if the files are of
  difference size.

  /c
  Ignore case.

copy
Copy one or more files.

  copy [/a|/b] [d:][path]file [[/a|/b] +[d:][path]file] [...] [dest] [/v]

Options:
  d:path\file
  The name of a file to copy.  This is the source.

  dest
  The name of the files to copy to.  This is the destination.  If the
  dest filename contains a *, then replace this part of
  the filename with the same part as the source.

  /a
  Copy an ASCII file.  If this precedes a filename in a list of files,
  then from this file on, copy as ASCII files.

  /b
  Copy a binary file.  This is the default. If this precedes a
  filename in a list of files, then from this file on, copy as binary
  files.

  /v
  Verify that the files are written correctly.

ctty
Change the terminal device for your DOS session.

  ctty device

Options:
  device
  The device to use.  Valid devices are prn, lpt1, lpt2, lpt3, con,
  aux, com1, com2, com3, com4.

date
Display or change the date.

  date [date]

Options:
  date
  The new date for your system.  Values for the day, month, and year
  must be specified, and values may be specified by periods, hyphens,
  or slashes.  Either a 4-digit or 2-digit year may be used.  If a
  2-digit year is specified, the year must be in the range 00-99.  If
  the year is xx:00-79, assume 20xx.  If xx:80-99, assume 19xx.

  If no date is given, display the current date and prompt for a new
  date.

del, erase
Delete files.

  del [d:][path]file [options]
  erase [d:][path]file [options]

Options:
  d:path\file
  A file to delete.  A period may be used to specify all files in the
  current directory, and is the same as *.*.

  /p
  Prompt before deleting the file.

deltree
Delete an entire directory tree, including subdirectories.

  deltree [options] [d:]path

Options:
  /Y
  Yes, delete without asking.

  d:\path
  The directory to delete, including subdirectories.

dir
Displays the contents of a directory.

  dir [d:][path][file] [options]

Options:
  d:path\file
  A specific file to display.

  /p
  Display one page of the listing at a time.

  /w
  Display the listing in wide format.

  /a[:attribs]
  Display only the files and directories with the specified
  attributes.  Default is /a:hsdar.  You may use the following for
  attribs:
    h | -h
    Hidden files.  -h for files that are not hidden.

    s | -s
    System files.  -s for files that are not system files.

    d | -d
    Directories.  -d for files.

    a | -a
    Files with the archive bit.  -a for files without the archive bit.

    r | -r
    Read-only files.  -r for files that are not read-only.

  /o[:order]
  Display the listing in the specified order. You may use the
  following to specify the sort order:
    a | -a
    Sort alphabetically A-Z.  -a to sort Z-A.

    e | -e
    Sort by extension A-Z.  -a to sort by extension Z-A.

    d | -d
    Sort by date and time.  -d to sort in reverse order.

    s | -s
    Sort by size, smallest-biggest.  -s to sort biggest-smallest.

    g | -g
    Group directories first.  -g to group directories last.

  /s
  List every occurrence in all subdirectories.

  /b
  Bare format.  List one name per line.

  /L
  Display names in lowercase.

diskcomp
Compares the contents of two floppy disks, track by track

  diskcomp [d: [d:]] [options]

Options:
  d:
  The drive letter for a floppy disk.  If only one drive letter is
  given, assume the working drive (if a floppy drive.)  If no drive
  letters are given, assume both are the working drive (if a floppy).
  If both drives are the same, diskcomp will read one floppy at a
  time, and you may need to swap floppies.

  /1
  Compare only the first sides of the disks, even if double-sided
  disks.

  /8
  Compare only the first 8 sectors per track.

diskcopy
Copy the contents of a floppy disk to a second floppy.

  diskcopy [d: [d:]] [options]

Options:
  d:
  The drive letter for a floppy disk.  If only one drive letter is
  given, assume the working drive (if a floppy drive.)  If no drive
  letters are given, assume both are the working drive (if a floppy).
  If both drives are the same, diskcopy will read one floppy at a
  time, and you may need to swap floppies.

  /1
  Copy the first side only, even if double-side.

  /V
  Verify that the data is copied correctly.

echo
Displays a message.

  echo [message]

edit
Starts the DOS editor.

  edit [[d:][path]file] [options]

Options:
  /B
  Use a black-and-white (mono) display.

  /G
  Use faster update for a CGA screen.

  /H
  Display using the highest video/text resolution available.

  /NOHI
  Do not use high-brightness colors.

emm386

The expanded memory manager (EMM) for '386 systems (or better)

  emm386 [on|off|auto] [w=on|w=off]

Options:
  on | off
  Turn expanded memory support on or off.  Default=on.

  auto
  Only support expanded memory when a program asks for it.

  w=on | w=off
  Enables or disables support for the Wietek coprocessor.
  Default=off.

exe2bin
Converts EXE programs to binary format. This is a software developer's tool.

  exe2bin [d:][path]file.exe [d:][path]file.bin

fastopen
Decreases the amount of time needed to load files and programs.

[Dropped, because disk cache should be (eventually) implemented in the kernel, not by an external program. Also, Fastopen was originally created to increase DOS application performance on systems with slow drives, where today disk drives are much faster.]

  fastopen d:[[=]nn] [d:[[=]nn]] .... [options]

Options:
  d:
  The drive on which to use fast-open.

  nn
  The number of files that can be tracked, in the range 10-999.
  Default=48.

  /X
  Create the cache in expanded memory instead of conventional memory.

fc
Compare two files.

  fc [options] [d:][path]file1 [d:][path]file2

Options:
  /A
  Abbreviate the ASCII output.  Instead of displaying all lines, fc
  will display the first and last lines that are different.

  /C
  Ignore the case of letters.

  /L
  Compare in ASCII mode.  Displays all lines that differ.  This is the
  default mode for files that are not EXE, COM, SYS, OBJ, LIB, or BIN.

  /LBn
  Sets the number of lines for the internal buffer.  Default=100.  If
  the files have more than this many differences, fc will quit.

  /N
  Display line numbers.

  /T
  Do not expand tabs to spaces.  Default is to expand tabs to 8-space
  stops during comparison.

  /W
  Compress white space during comparison.

  /nnn
  Specifies the number of lines that must match after a miscompare for
  the files to be resynchronized.  Default=2.

  /B
  Compare in binary mode.  Does not attempt to resynchronize after a
  miscompare.

fdisk
Configures a hard disk.

  fdisk

find
Displays lines in a text file that contain a string.

  find [options] string [d:][path]file

Options:
  /V
  Invert the search.  Display lines that do NOT contain the string.

  /C
  Only display a count of the matching lines.

  /N
  Display line numbers.

  /I
  Ignore case during the comparison.

format
Format a hard drive or floppy disk.

  format d: [options]

Options:
  d:
  The hard drive or floppy disk to format.

  /V:label
  Assign this label to the formatted disk.

  /Q
  Do a quick format.  This clears the FAT and root directory, but does
  not erase the disk.

  /U
  Do an unconditional format.

  /F:size
  Format the disk to a specific size.  Valid values are:
    160 | 160k | 160kb
    Format to 160kb.

    180 | 180k | 180kb
    Format to 180kb.

    320 | 320k | 320kb
    Format to 320kb.

    360 | 360k | 360kb
    Format to 360kb.

    720 | 720k | 720kb
    Format to 720kb.

    1200 | 1200k | 1200kb | 1.2 | 1.2m | 1.2mb
    Format to 1.2MB.

    1440 | 1440k | 1440kb | 1.44 | 1.44m | 1.44mb
    Format to 1.44MB.

    2880 | 2880k | 2880kb | 2.88 | 2.88m | 2.88mb
    Format to 2.88MB.

  /B
  Reserve space to make a bootable disk.

  /S
  Make a system disk (copy files to make it bootable.)

  /T:tracks
  Specify the number of tracks on the disk.

  /N:sectors
  Specify the number of sectors.

  /1
  Format a single-sided disk.

  /4
  Format a 5-1/4 inch 360KB DSDD disk on a 1.2MB drive.

  /8
  Format a 5-1/4 inch disk with 8 SPT.

graftabl
Load the graphics table for a specific code page.

[Dropped, because most monitors can display extended characters (128-255) without Graftabl. This command was originally introduced by MS-DOS to support the extended character set on systems that were not originally equipped to display them properly. While some users may miss this command, we feel there are not enough systems that still need Graftabl to justify its inclusion in the Spec.]

  graftabl [nnn] [options]

Options:
  nnn
  The code page you want to load.

  /STATUS
  Display the code page that was loaded, or is being loaded.

graphics
Allow Prtscr to print graphics screens.

  graphics [[d:][path]file] [type] [options]

Options:
  d:path\file
  The full pathname of the printer profile.

  type
  The printer type.  Currently defined printer types are:
  [this list has been amended to support only the printer types that
  are in current use today]

    epson
    Any Epson-compatible dot-matrix printer (default).

    hpdefault
    Any HP-compatible PCL printer.

    postscript
    Any Postscript-compatible printer.
    [this printer was not originally defined by the MS-DOS Graphics
    command, but we are adding it because many users have Postscript
    printers.]

  /R
  Print the image reversed (white on black).  Default is black on
  white.

  /B
  Print the background in color, if possible.

  /PRINTBOX:STD | /PRINTBOX:LCD
  Print using the standard aspect ratio, or using an LCD aspect ratio
  (1:1).

  /LCD
  Same as /PRINTBOX:LCD

help
Provides on-line help.

  help [topic]

join
Join a drive to a directory.

  join d: d:path
  join d: /D

Options:
  d:
  The drive letter you want to set up.

  d:path
  The full path which will be assigned to the drive.

  /D
  Delete this join definition.

keyb
Configure the keyboard for a specific language.

  keyb [xx[,nnn[,[d:][path]file]]] [options]

Options:
  xx
  The keyboard code.

  nnn
  The code page.

  d:path\file
  The full path to a keyboard definition file.  Default=KEYBOARD.SYS

  /E
  Use an enhanced keyboard.

  /ID:nnn
  Specify the keyboard for countries that have more than one keyboard
  layout for the same language.
  

label
Assign a disk label to a drive.

  label [d:] [label]

Options:
  d:
  The drive to assign a label.  If missing, use the current drive.

  label
  The label to assign to the drive.  If missing, prompt for it.

loadhigh, lh
Load a program into high memory.

  loadhigh [d:][path]file [options]
  lh [d:][path]file [options]

Options:
  d:path\file
  The program to load into high memory.

  options
  These are the options to the program that you are loading.

mem
Display the amount of memory installed, and the amount available.

  mem [options]

Options:
  /PROGRAM | /P
  Display the programs that are loaded in memory.

  /DEBUG | /D
  Prints lots of debugging information.

  /CLASSIFY | /C
  Display the programs that are loaded in memory, and how much
  conventional, expanded, and extended memory each is using.

mirror
Mirror information about the disk in a way that unformat and undelete can use to recover the disk.

  mirror d: [/L] [/Td:entries] [/Td:entries] [...]
  mirror [/U]
  mirror [/PARTN]

Options:
  d:
  The drive that you want to be able to recover later using undelete
  or unformat.

  /L
  Retain only the latest information.

  /Td:[entries]
  Track information using a log file on the specified disk, and the
  number of entries in the log file.

  /U
  Unload a previously loaded copy of the program.

  /PARTN
  Track information about the disk partitions.

mkdir, md
Creates a directory.

  mkdir [d:]path
  md [d:]path

mode
Set or display the operating mode of system devices.

Display the mode or status:

  mode [device] [/STATUS]

If no devices are named, or if /STATUS is the only argument, display the operating mode of all devices. If a device is named with no settings, or with the /STATUS option, display the operating mode for this device.

Set the mode:

  mode LPTn: [options]
  mode COMn: [options]
  mode device codepage [options]
  mode adapter [options]
  mode CON: [options]

more
Displays a text file one screen at a time.

  more < [d:][path]file
  command | more

Options:
  d:path\file
  A text file that you want to display.

  command
  A command whose output you will pipe to the more program.

nlsfunc
Adds NLS (national language support) functionality.

  nlsfunc [[d:][path]file]

Options:
  d:path\file
  The full path to a file containing NLS information.  If no file is
  given, nlsfunc will select its own default.

pause
Suspend execution of whatever you are doing, and wait for a keystroke.

  pause

print
Print a file in the background, while you run other DOS commands.

  print [options] [[d:][path]file] [[d:][path]file] [...]

Options:
  d:path\file
  The file that you want to print.

  /D:device
  Specify the name of the device to print to.  If not given, Print
  will use the default LPT: device.

  /B:size
  Set the size of the buffer, in bytes, in the range 512-16384.  The
  default is 512.

  /U:ticks
  The number of clock ticks, in the range 1-255, that Print is to wait
  for the printer to become available before printing the job.

  /M:ticks
  The maximum number of ticks for sending a single character to the
  printer.  In the range 1-255.

  /S:ticks
  The number of clock ticks, in the range 1-255, for the background
  spooler process.  Default=8.  Larger numbers will speed up
  printing but slow down other DOS programs.

  /Q:nn
  The number of files that will be allowed in the print queue, in the
  range 1-32.  Default=10.

  /T
  Remove all files in the print queue.  Terminate the job that is
  currently being printed.

  /C
  Cancel jobs in the print queue.  If this is used with a list of file
  names, remove only those files from the queue.  If this is used
  alone, cancel all jobs but do not terminate the current job.

  /P
  Add a file to the print queue.  If this precedes a list of files,
  print only those files.  You may use /P and /C together on the same
  command line.

  If no options are given to Print, only files, assume /P.  If no
  options and no files are provided, display the contents of the print
  queue.

recover
Recover data from a bad diskette or hard disk.

[Dropped, because there are a variety of shareware and freeware disk recovery programs already avaialble, and it would be silly of us to write another one just because MS-DOS included a Recover command. If you need a disk recovery program, go download one, or purchase a third-party recovery program such as Norton's Utilities.]

  recover [d:][path]file
  recover d:

Options:
  d:path\file
  The exact file that you want to recover, using file recovery.  Use
  this when you know exactly the name of the file that needs to be
  recovered.

  d:
  The drive letter of a diskette or hard disk to recover.  This
  attempts recovery on all files.

rename, ren
Re-name a file or set of files.

  rename [d:][path]file1 file2
  ren [d:][path]file1 file2

Options:
  d:path\file1
  The source file, the original file that needs to be renamed.

  file2
  The new name for file1.  You may not include a path.

  You can use wildcards (* and ?) to specify a set of files.  If you
  use wildcards in file1, you must use wildcards in the same position
  in file2.

rmdir, rd
Remove a directory.

  rmdir [d:]path
  rd [d:]path

scandisk
Scan a drive for errors, and report/repair any that were found.

setver
Set the DOS version that is reported to programs.

[Dropped, because this was a legacy migration thing, to allow programs that needed to run on a particular DOS version to be carried forward. Since later versions of DOS are (always?) compatible with earlier versions, a Setver command is not really needed.]

  setver [d:][path] [file nn.xx]
  setver [d:][path] [file [options]]

Options:
  d:path
  The path to the SETVER program data.

  file
  The name of a program that you want to add to the version table.

  nn.xx
  The DOS version number that will be reported to the program.

  /DELETE
  Remove this program from the version table.

  /QUIET
  Do not display any text while adding/deleting table entries.

  If no options are given to SETVER, print the current version table.
  If only 'file' is given, with no options, then print the DOS version
  that will be reported to that program.

share
Share large files with other programs.

  share [options]

Options:
  /F:size
  Set the size, in bytes, for file sharing information.  Default=2048.

  /L:nn
  Set the number of files that can be locked at once.  Default=20.

sort
Sort a file, or sort its input.

  sort [options] [d:][path]file
  command | sort [options] [d:][path]file

Options:
  /R
  Sort in reverse order.

  /+n
  Begin sorting at column n in each line of text.  Default=1.

subst
Substitute a path with a drive letter.

  subst [d: [d:]path]
  subst d: /D

Options:
  /D
  Delete this substituted drive.

sys
Make a floppy disk or hard disk bootable.

  sys [[d:]path] d:

Options:
  d:path
  The (optional) location of the system files.

  d:
  The drive to make bootable.

time
Set or display the system's idea of the time.

  time
  time [hh:mm[:ss[.ss]]{A|P}]

Options:
  hh:mm:ss.ss
  The exact time to set for your system.  'hh' is the hour on a 12 or
  24 hour clock.  'mm' is the minutes.  'ss.ss' is the seconds and
  decimal seconds.

  A | P
  Set the time to AM or PM if using a 12 hour clock.

  If no time is given, display the current time, and prompt for a new
  time.

tree
Display the structure of a directory tree.

  tree [d:][path] [options]

Options:
  d:path
  The drive and path to start from.  If no path is given, start from
  the current directory.

  /F
  Display the names of files in each directory.

  /A
  Use ASCII characters to visually represent the directory structure.

type
Display the contents of a text file.

  type [d:][path]file

undelete
Recover a deleted file. Information from MIRROR may be useful.

  undelete [[d:][path]file] [options]

Options:
  d:path\file
  The name of the file to recover.  If not specified, try to recover
  all files in the working directory.

  /LIST
  List all the files that might be recoverable but do not recover
  them.

  /ALL
  Recover all deleted files in the working directory.

  /DOS
  Recover only those files listed as deleted from DOS.

  /DT
  Recover only those files that are delete-tracked from the DOS
  MIRROR mirror program.

unformat
Attempt to unformat a disk. Information from MIRROR may be useful.

  unformat [d:] [options]

Options:
  d:
  The drive to attempt recovery.

  /J
  Checks that data from MIRROR is present and matches the
  disk information.

  /U
  Attempts to unformat a disk without a MIRROR file.

  /L
  List every file and directory that might be recovered.

  /TEST
  Simulate a recovery, but do not attempt to recover the disk.

  /P
  Print the output on LPT1:

  /PARTN
  Attempt to recover the partition table.

ver
Display the version of the DOS kernel that you are using.

  ver

verify
Turn file verification on or off. This tells DOS to check that files are correctly written to disk.

  verify [ON | OFF]

Options:
  ON | OFF
  Turn file verification on or off.

  If no options are given, display the status of file verification.

vol
Display the volume label of a disk.

  vol [d:]

Options:
  d:
  The drive to display the volume label.

xcopy
Copies files and directories, including subdirectories.

  copy {d: | [d:]path} [d:][path] [options]

Options:
  {d: | d:path}
  The source to copy from.  This must be either a drive or a full
  path.

  d:path
  The destination to copy to.  If not present, assumes the working
  directory.

  /A
  Only copy files with the Archive bit set.

  /M
  Only copy files with the Archive bit set, and turn off the A bit.

  /D:date
  Only copy files modified after 'date'.

  /P
  Prompt before copying a file.

  /S
  Copy subdirectories, except empty ones.

  /E
  Copy subdirectories, even if empty.

  /V
  Verify each file as it is written to disk.

  /W
  Wait before copying any files.  Presents a prompt, which the user
  must first acknowledge.

The following commands are considered replacements for proprietary-named commands. These commands do not have the same name as their MS-DOS counterpart due to possible legal conflicts.

These may be implemented either internally or externally to the shell, and need not necessarily be identical to their MS-DOS counterpart. The following should be taken as guidelines and not a thorough design specification:

Alias
Create an alias for a command.

  alias [aliascommand [realcommand]]

Options:
  aliascommand
  The new name for a command.  For example, 'ls' might be an alias for
  the DIR command.

  realcommand
  The real command that is executed in place of realcommand, including
  options.

  If no options are given, display the list of currently defined
  aliases.  If only the aliascommand is given, display its definition.

Backup And Restore
Commands to backup and restore a filesystem.

  backup d:[path[files]] d:[path]
  restore d:[path] d:[path[files]]

Options:
  d:path\files
  A list of files that need to be backed up.

  d:path
  The destination for the backup.  This may be a path or a drive
  letter.

BASIC Language
Starts the BASIC language environment.

  basic [[[d:]path]file]

Options:
  d:path\file
  The name of the BASIC program to load.  If no file is specified,
  just open the BASIC environment.

Debugger
Perform debugging on a file, and perhaps some assembly.

  debug [[[d:]path]file]

Options:
  d:path\file
  The name of a debugger script file.  The debugger should allow
  the user to specify a file name to load by the script file.

Disk Defragmenter
Optimizes the hard disk space.

  defrag [d:]

Options:
  d:
  The letter of the drive you want to optimize.  If you do not specify
  a drive, it uses the working drive.

Line Editor
Allows a user to perform Stream Editing, either at the console or via a shell script.

  edline [[[d:]path]file]

Options:
  d:path\file
  The name of a line editor script file.  The line editor should allow
  the user to specify a file name to load by the script file.  Or, if
  the script file does not specify a file name, use stdin and write to
  stdout.  If no script file is specified, take input from the
  console.

The following are exceptions, and must be provided for as internal commands in the shell:

call
Calls a batch file from within a batch file.

  call [d:][path]file [options]

Options:
  d:path\file
  The name of the batch file to call.

  options
  The options that are passed to the batch file being loaded.

exit
Exits the shell.

  exit

for
Runs a command for a each in a list of files.

  for %var IN (list) DO command [options]

Options:
  var
  The name of an environment variable.  You will use this variable in
  the 'options portion.

  list
  A list of files that will be acted upon.

  command
  A command to run against the list.

  options
  The options passed to the 'command'.  In the 'options', you may
  reference the 'var' from above, preceding it with '%'.

goto
Branch to a label in a batch file.

  goto label

Options:
  label
  The name of a label in a batch file.  The label must exist.  All
  labels are defined by placing the label on a line by itself,
  preceding it with ':'.  Spaces are not allowed in a label.

if
Perform a test in a batch file.

  if [NOT] expr command [options]

Options:
  NOT
  Negates the expression.  If the 'expr' is true, NOT makes it false.

  expr
  A test expression, which evaluates to a true or false value.  Valid
  expressions must include:
    ERRORLEVEL nnn
    Returns true if the error level is set to nnn.

    s1==s2
    Returns true if string 's1' equals string 's2'.

    EXIST [d:][path]file
    Returns true if d:path\file is a file.

  command
  The DOS command to execute if the test is true.

path
Set the search path for programs.

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

Options:
  d:path
  A directory that contains programs, to add to the PATH setting.

  If no options are given to the PATH command, then display the
  current value of the PATH setting.

prompt
Sets the prompt for the command shell.

  prompt [text]
  SET PROMPT=text

Options:
  text
  The text to use for the command shell prompt.  The '$' is a special
  character, and can be used to insert special text in the prompt:
    $Q
    an equal sign

    $$
    a dollar sign

    $T
    the current time

    $D
    the current date

    $P
    the working path (drive and directory)

    $V
    the version of DOS (or the shell, either is acceptable)

    $N
    the working drive letter

    $G
    a greater-than sign

    $L
    a less-than sign

    $B
    the pipe symbol

    $_
    a literal newline

    $E
    an escape character (can be used to start ANSI commands)

    $H
    a literal backspace character

  If no options are given to PROMPT, display the current value of the
  PROMPT setting.

rem
Ignores the current line. This is a comment.

set
Assign a value to an environment variable.

  set var=value

Options:
  var
  The name of an environment variable.

  value
  The value to assign to the variable.

shift
Shift the position of all command line arguments downward by one.

  shift [n]

Options:
  n
  The number of positions to shift the command line arguments.
  Default=1.

Changes to this document:

Apr 1999: Dropped the Setver program from the Spec.

Jan 1999: A few traditional MS-DOS commands have been dropped from the Spec. Dropping from the Spec does not mean that such a program will be ignored if one ever comes along, but this does mean that we will not actively seek out to develop a new version. This is because they were considered as part of a legacy migration thing for MS-DOS, which the FreeDOS Project is not interested in carrying forward. Where a program has been dropped from the Spec, an annotation has been made to explain why.

Sep 1998: First revision.


Copyright © 1998 Jim Hall

Unless otherwise stated, FD-DOC HOWTO documents are copyrighted by their respective authors. FD-DOC HOWTO documents may be reproduced and distributed in whole or in part, in any medium physical or electronic, as long as this copyright notice is retained on all copies. Commercial redistribution is allowed and encouraged; however, the author would like to be notified of any such distributions.

All translations, derivative works, or aggregate works incorporating any FD-DOC HOWTO documents must be covered under this copyright notice. That is, you may not produce a derivative work from a HOWTO and impose additional restrictions on its distribution. Exceptions to these rules may be granted under certain conditions; please contact the FD-DOC HOWTO coordinator at the address given below.

In short, we wish to promote dissemination of this information through as many channels as possible. However, we do wish to retain copyright on the HOWTO documents, and would like to be notified of any plans to redistribute the HOWTOs.

If you have any questions, please contact the FD-DOC coordinator at jhall1@isd.net.

Hosted by uCoz