DOS Days

A Guide to DOS Commands

This page provides you with a list of all available DOS commands, their purpose, and how to run them. Many DOS commands matured as the DOS version increased, with more options (called 'arguments') as time went on.

This table provides a summary of the various DOS commands, whether they're internal (stored inside COMMAND.COM) or external (stored in their own file).

APPEND DEL (or DELETE) FDISK MORE SCANDISK
ASSIGN DELTREE FIND MOVE SET
ATTRIB DIR FOR MSAV SETVER
BACKUP DISKCOMP FORMAT MSBACKUP SHARE
BREAK DISKCOPY GOTO MSCDEX SHIFT
CALL DOSKEY GRAPHICS MSD SMARTDRV
CD (or CHDIR) DOSSHELL HELP NLSFUNC SORT
CHCP DRVSPACE IF PATH SUBST
CHKDSK ECHO INTERLNK PAUSE SYS
CHOICE EDIT INTERSVR POWER TIME
CLS EDLIN KEYB PRINT TREE
COMMAND EMM386 LABEL PROMPT TYPE
COPY ERASE LH (or LOADHIGH) QBASIC UNDELETE
CTTY EXIT LOADFIX RD (or RMDIR) UNFORMAT
DATE EXPAND MD (or MKDIR) REM VER
DBLSPACE FASTHELP MEM REN (or RENAME) VERIFY
DEBUG FASTOPEN MEMMAKER REPLACE VOL
DEFRAG FC MODE RESTORE VSAFE
        XCOPY

Batch Files and Batch Commands

Some of the internal DOS commands are really only relevant when used in what are called "Batch" files. These are basically files that contain a text-readable script that execute one command after another in order. You can use batch files to perform simple logic (IF..THEN..ELSE or FOR..NEXT loops, for instance), similar to BASIC.

Batch files had the file extension, .BAT, which was one of only three file extensions that DOS interprets as 'executable' (the others are .COM and .EXE), meaning you don't need another program to call it - you just type the name and it will run from DOS.

 

DOS Commands and How to Use Them

Below are the details of each command, their command-line arguments (sometimes called parameters), and some examples of how to run them:

APPEND

Sets the path to be searched for data/text files (non-executables) or displays the current search path. The APPEND command is similar to the PATH command that tells DOS where to search for program files (files with a .COM, . EXEC, or .BAT file name extension).

If you're looking for a way to append one file to another, look up the COPY command instead, which allows you to use '+' between filenames to append them together.

Available from: DOS v3.3

APPEND
APPEND ;
APPEND [d:]path[;][d:]path[...]
APPEND [/X:on|off][/path:on|off][/E]

/X: [on | off] - The /X switch is used by DOS to guide the search path for programs (such as DOS commands). Set the /X switch before specifying paths to search. The /X switch can only be specified the first time you use the APPEND command. In versions after DOS Version 4 this parameter can be specified as either /X:on (to search appended directories when executing programs) or /X:off (to not search appended directories when executing programs). The default value is /X:off.

/Path:[on|off] - In DOS versions after DOS Version 4 the /Path: on|off option is used tell DOS whether to search the appended path for a data file when a path has been included with the name of the file the program is looking for. /path:off is the default.

/E - Use the command with the /E switch to store the names of the APPENDed directories in the DOS environment (refer to the SET command for more information about the DOS environment). The /E switch can only be specified the first time you use the APPEND command.

ASSIGN

Redirects requests for disk operations on one drive to a different drive. It can also display drive assignments or reset all drive letters to their original assignments. This command is particularly useful if a program is expecting to 'see' data on a given drive letter, but it's not the one currently assigned, for example installation programs.

Available from: DOS 2.0 - 6.22

ASSIGN [source] = [target] [/status]

[source] - The drive letter of the source drive you want to assign.

[target] - The drive letter of the target drive you want to use instead.

[/status] - Lists the current drive assignments

Examples for DOS versions before 5.0:

ASSIGN C = D

Example for DOS version 5.0 or later:

ASSIGN C: = D:

ATTRIB

Changes or views the attributes of one or more files. It defaults to displaying the attributes of all files in the current directory. The file attributes available include read-only, archive, system, and hidden attributes. The command has the capability to process whole folders and subfolders of files.

Available from: DOS 3.0

ATTRIB [d:][path]filename [/S]
ATTRIB [+ R|-R] [+A|-A] [+ H|-H] [+ S|-S] [d:][path]filename [/S]

+R - Use the +R option to make a file read-only. Read-only files may be read but they can`t be changed or deleted.

-R - Use the -R option to change the file protection attribute back to normal (so it can be read, changed, or deleted).

+A - Use the +A option to set the ARCHIVE attribute of a file. When the +A option is used, this flags the file as available for archiving when using the BACKUP or XCOPY commands.

-A - Use the -A option to turn off the ARCHIVE attribute.

+H - With DOS Versions 4 through 6, use the +H option to set the HIDDEN attribute of a file so that it will not appear in a directory listing.

-H - Use the -H option to turn off the HIDDEN attribute.

+S - With DOS Versions after Version 4, use the +S option to set the SYSTEM attribute of a file. When the +S option is used, this flags the file as a command file used only by DOS. The file will not appear in a directory listing. This attribute is generally reserved for programmers.

-S - Use the -S option to turn off the SYSTEM attribute.

/S - Use the /S switch to set attributes on subdirectories found within the specified path.

BACKUP

(See also RESTORE)
These are commands to backup and restore files from an external disk. These appeared in DOS version 2.0, and continued to PC DOS 5 and MS-DOS 6 (PC DOS 7 had a deversioned check). In DOS 6, these were replaced by commercial programs (CPBACKUP, MSBACKUP) licenced from Central Point Software, which allowed files to be restored to different locations. In DOS versions 3.3 - 5.0, BACKUP stored the data in a different format than earlier versions, which requires less disk space.

Available from: DOS 2.0

BACKUP [d:][path][filename] [d:][/S][/M][/A][/F:(size] [/P][/D:date] [/T:time] [/L:[d:][path]filename]

The initial drive, path and filename (with wildcards if you want) determine the file(s) to backup.

/A - Does not erase the files on the target disk (DOS normally will erase existing files on the target diskette before it starts backing up the files). Use of this option cancels the prompt to insert a diskette in the target drive before the copying starts, but after the target disk is filled with backed-up files, you will be prompted to insert a new diskette.

/F:(size) - Formats the target disk (if it is not already formatted). This option uses the FORMAT program which must, therefore, be accessible via the current path. In DOS Versions 4 and 5, you can use F:(size) if the capacity of the target diskette does not match that of the drive in which you put it. For example, if you are using a 360K diskette in a 1.2M drive, (size) can be 160, 180, 320, 360, 720, 1.2, 1.44, or (in DOS Version 5) 2.88.

/L - Makes an entry in the backup log in the file you specify here. If you use this option but do not specify a backup log file, the system creates the file BACKUP.LOG in the root directory of the source drive.

The backup log will contain:

1. The date and time that the files were backed up.
2. The name of the file that was backed up.
3. The number of the backup disk that contains the file.

The information stored in this file can be used when you want to restore a particular file from a backup disk.

If the backup log file you specify already exists, the current entry is added to the existing file.

/M - Only backs up files that have been modified since the last time the BACKUP command was used. This switch checks the archive attribute of a file. If the file`s archive attribute is set to off (-A), the file will not be backed up.

/P - Packs as many files as possible onto each diskette. This option will create a directory when that is the only way to pack more files onto the diskette.

/S - Causes files in the specified directory and all subdirectories below the specified directory to be backed up.

/D:(date) - Backs up files only if they have been created or modified on or after the date you enter.

/T:(time) - Backs up files only if they have been created or modified on or after the time you enter.

CALL

The call command is used in a batch file. It starts another batch file from within the calling batch file and returns when that one ends.

Available from: DOS 3.3

CALL [d:][path]batchfilename [options ]

 

CD (or CHDIR)

The CHDIR (or the alternative name, CD) command either displays or changes the current working directory.

Available from: DOS 2.0

CHDIR (CD) [d:]path
CHDIR (CD)[..]

To demonstrate how the CHDIR command accesses the DOS directory structure, assume that two directories, WORDS and FILES have been created on a disk. These two directories are to be found within the root directory. Assume also that an additional directory, LETTERS is to be found within the WORDS directory.

To change to the directory LETTERS (that is within the directory WORDS) on the root directory of drive C, enter

cd \words\letters

The command indicates the path sequentially down through the directory path: the first backslash indicates the root directory, down through the directory WORDS, down to the target directory LETTERS.

If you are already working in the WORDS directory, you can change back to the root directory simply by entering

cd \

To change to a directory path other than through the root directory, do not enter the leading backslash. For example, if you are working in the WORDS directory, you can change to the LETTERS directory without going through the root directory by entering

cd letters

A shortcut method to change to the directory immediately above the current directory allows you to enter the CHDIR command followed by two periods. For example, to change from the LETTERS directory to its parent directory, WORDS, enter

cd ..

Enter it again to change to the next higher directory (in this case, the root directory).

 

CHCP

The command either displays or changes the active code page used to display character glyphs in a console window. The NLSFUNC command must be used prior to using this command. Also, device drivers must be prepared in advance (refer to the MODE command).

If you select a code page that has not been prepared for your system, DOS will display an error message similar to the following:

Code page xxx not prepared for system

Active code page: xxx

Prepared system code pages: xxx xxx

The Xs will be replaced by the appropriate number. If you change code pages and a device has not been prepared for use with that code page, the code page will still be changed. However, DOS will display an error message similar to the following:

Code page xxx not prepared for device xxx.

The Xs will be replaced by the appropriate number.

If you enter CHCP without entering a number, the program will display a message similar to the following:

Active code page 437
Prepared code pages 437 863


To change the code page setting from 437 to 863, enter

chcp 863

CHKDSK

CHKDSK verifies a storage volume (for example, a hard disk, disk partition or floppy disk) for file system integrity. The command has the ability to fix errors on a volume and recover information from defective disk sectors of a volume.

Available from: DOS 1.0

CHKDSK [d:][path][filename] [/F][/V]

/F - Corrects errors when it finds them. If CHKDSK finds lost clusters (parts of files or programs that have become separated from the rest of the file) it will write the lost segment to new files and provide the filename FILEnnnn (nnnn will be a number starting with 0000).

/V - Displays progress messages while CHKDSK is in operation.

filename - If you enter a filename, CHKDSK also reports how many files are stored in non-contiguous blocks (see explanation of non-contiguous blocks above).

CHOICE

Used in batch files to prompt the user to select one item from a set of single-character choices. Choice was introduced as an external command with MS-DOS 6.0; Novell DOS 7 and PC DOS 7.0. Earlier versions of DR DOS supported this function with the built-in switch command (for numeric choices) or by beginning a command with a question mark. This command was formerly called ync (yes-no-cancel).

CLS (or CLRSCR)

The CLS or CLRSCR command clears the terminal screen.

COPY

Copies files from one location to another. It is used to make copies of existing files. This command can be used to combine multiple files into target files. The destination defaults to the current directory. If multiple source files are indicated, the destination must be a directory, or an error will result. COPY has the ability to concatenate files. The command can copy in text mode or binary mode; in text mode, copy will stop when it reaches the EOF character; in binary mode, the files will be concatenated in their entirety, ignoring EOF characters.

Files may be copied to devices. For example, copy file con outputs file to the screen console. Devices themselves may be copied to a destination file, for example, copy con file takes the text typed into the console and puts it into FILE, stopping when EOF (Ctrl+Z) is typed.

CTTY

Defines the terminal device (for example, COM1) to use for input and output.

DATE

Displays the system date and prompts the user to enter a new date. Complements the TIME command.

DEBUG

A very primitive assembler and disassambler.

DEFRAG

The command has the ability to analyze the file fragmentation on a disk drive or to defragment a drive. This command is called DEFRAG in MS-DOS/PC DOS and diskopt in DR-DOS.

DEL (or ERASE)

DEL (or the alternative form ERASE) is used to delete one or more files.

DELTREE

Deletes a directory along with all of the files and subdirectories that it contains. Normally, it will ask for confirmation of the potentially dangerous action. We know that the RD(RMDIR) command can not delete a directory if the directory is not empty. DELTREE command can be used to delete the whole directory if the directory is not empty.

It is available only in versions of MS-DOS 6.0 and higher.

DIR

The DIR command displays the contents of a directory. The contents comprise the disk's volume label and serial number; one directory or filename per line, including the filename extension, the file size in bytes, and the date and time the file was last modified; and the total number of files listed, their cumulative size, and the free space (in bytes) remaining on the disk. The command is one of the few commands that exist from the first versions of DOS. The command can display files in subdirectories. The resulting directory listing can be sorted by various criteria and filenames can be displayed in a chosen format.

ECHO

The ECHO command prints its own arguments back out to the DOS equivalent of the standard output stream. (Hence the name, ECHO) Usually, this means directly to the screen, but the output of echo can be redirected, like any other command, to files or devices such as a printer. Often used in batch files to print text out to the user during an operation.

Another important use of the echo command is to toggle echoing of commands on and off in batch files. Traditionally batch files begin with the @echo off statement. This says to the interpreter that echoing of commands should be off during the whole execution of the batch file, thus resulting in a "tidier" output (the @ symbol declares that this particular command (echo off) itself should also be executed without echo.)

EDIT

EDIT is a full-screen text editor, included with MS-DOS 5 and 6, OS/2 and Windows NT to 4.0 The corresponding program in PC DOS 6 and later use the DOS E Editor and DR-DOS used editor up to version 7.

EDLIN

DOS line-editor. It can be used with a script file, like debug, this makes it of some use even today. The absence of a console editor in MS-DOS/PC DOS 1-4 created an after-market for third-party editors. In DOS 5, an extra command "?" was added to give the user much-needed help. DOS 6 was the last version to contain EDLIN; for MS-DOS 6, it's on the supplemental disks, while PC DOS 6 had it in the base install. Windows NT 32-bit, and OS/2 have Edlin.

EXE2BIN

Converts an executable (.exe) file into a binary file with the extension .com, which is a memory image of the program. The size of the resident code and data sections combined in the input .exe file must be less than 64 KB. The file must also have no stack segment.

EXIT

Exits the current command processor. If the exit is used at the primary command, it has no effect unless in a DOS window under Microsoft Windows, in which case the window is closed and the user returns to the desktop.

FASTOPEN

The FASTOPEN command acts as a file / directory cache to speed up locating files on a hard disk. After running FASTOPEN on a specific hard disk drive letter,

The syntax for running this external command is:

FASTOPEN x:=<number of files to store in memory> /X

x: is the drive letter of the hard disk you want to run the command against.
<number of files> is the quantity of file locations to store.
/X will make use of EMS (Expanded Memory) for the buffer space

It is available from DOS 3.3 and later.

FC (or COMP)

Stands for File Compare. Shows differences between any two files, or any two sets of files.

FDISK

The FDISK command manipulates hard disk partition tables. The name derives from IBM's habit of calling hard drives fixed disks. FDISK has the ability to display information about, create, and delete DOS partitions and "logical drives" within a partition. It can also install a standard master boot record on the hard drive if one has become corrupted.

Running FDISK with no command-line arguments takes you to a menu with options. Running with any of the arguments below simply performs that task and returns you to the DOS prompt:

FDISK /MBR Only from DOS version 5.0 and later. This is an undocumented command that rewrites the Master Boot Record on the current hard disk.
FDISK /CMBR <drive number> This performs the same as the /MBR argument, but allows you to rewrite the MBR on a different drive. To get the list of available drive numbers, run FDISK /STATUS
FDISK /STATUS Lists the current status of all detected hard disks in your system.
FDISK <drive number>/PRI:<size> Creates a primary DOS partition of <size> in megabytes on the hard disk <drive number>
FDISK <drive number>/EXT:<size> Creates an extended DOS partition of <size> in megabytes on the hard disk <drive number>
FDISK <drive number>/LOG:<size> Creates a logical drive in the extended DOS partition of <size> in megabytes on the hard disk <drive number>
FDISK /Q Prevents FDISK from automatically forcing a reboot of the system upon exit.
FDISK /ACTOK Prevents FDISK from performing a disk integrity check, allowing drives to be created faster.
FDISK /FPRMT By default, FDISK does not use FAT32 on any drives smaller than 540 MB. This argument prevents FDISK from prompting about FAT32 and will force FDISK to use FAT32 on smaller drives.
Can only be used on versions of FDISK that support FAT32.

FIND

The FIND command is a filter to find lines in the input data stream that contain or don't contain a specified string and send these to the output data stream. It may also be used as a pipe.

FOR

A batch command. The FOR loop can be used to parse a file or the output of a command.

FORMAT

Deletes the FAT entries and the root directory of the drive/partition, and reformats it for MS-DOS. In most cases, this should only be used on floppy drives or other removable media. This command can potentially erase everything on a computer's drive.

GRAPHICS

A TSR program to enable the sending of graphical screen dumps to printer by pressing <Print Screen>.

HELP

Gives help about DOS commands.

IF

A batch command. Evaluate the condition, and only if it is true, then it executes the remainder of the command line Otherwise, it skips the remainder of the line and continues with next command line.

INTERLNK (and INTERSVR)

Interlink and its counterpart, Interserver, provide a means to transfer files from one computer to another via a null modem cable. In MS-DOS the files were called INTERLNK and INTERSVR. In DR-DOS both sides used the same program, called FILELINK .

Network PCs using a null modem cable or LapLink cable. The server-side version of InterLnk, it also immobilizes the machine it's running on as it is an active app (as opposed to a TSR) which must be running for any transfer to take place. DR-DOS' filelink is executed on both the client and server.

New in PC DOS 5.02 and MS-DOS 6.0.

JOIN

The JOIN command attaches a drive letter to a specified directory on another drive.The opposite can be achieved via the SUBST command.

LABEL

Changes the label on a logical drive, such as a hard disk partition or a floppy disk. See also VOL.

LOADFIX

Loads a program above the first 64K of memory, and runs the program. The command is included only in MS-DOS/PC DOS. DR-DOS used memmax, which opened or closed lower, upper, and video memory access, to block the lower 64K of memory.

LH (or LOADHIGH)

Used in CONFIG.SYS, this command loads the driver into the High Memory Area (HMA).

MD (or MKDIR)

Makes a new directory. The parent of the directory specified will be created if it does not already exist.

MEM

Displays memory usage. It is capable of displaying program size and status, memory in use, and internal drivers.It is internal command.

MEMMAKER

Starting with version 6, MS-DOS included the external program MemMaker which was used to free system memory (especially Conventional memory) by automatically reconfiguring the AUTOEXEC.BAT and CONFIG.SYS files. This was usually done by moving TSR programs and device drivers to the upper memory. The whole process required two system restarts. Before the first restart the user was asked whether he/she wanted to enable EMS Memory, since use of expanded memory required a reserved 64KiB region in upper memory. The first restart inserted the SIZER.EXE program which gauged the memory needed by each TSR or Driver. MemMaker would then calculate the optimal Driver and TSR placement in upper memory and modify the AUTOEXEC.BAT and CONFIG.SYS accordingly, and reboot the second time.

MEMMAKER.EXE and SIZER.EXE were developed for Microsoft by Helix Software Company and were eliminated starting in MS DOS 7 / Windows 95. PC DOS uses another program RamBoost to optimize memory, working either with PC DOS's HIMEM/EMM386 or a third-party memory manager. RamBoost was licensed to IBM by Central Point Software.

MODE

Configures system devices. Changes graphics modes, adjusts keyboard settings, prepares code pages, and sets up port redirection.

MORE

The MORE command paginates text, so that one can view files containing more than one screen of text. More may also be used as a filter. While viewing MORE text, the return key displays the next line, the space bar displays the next page.

MOVE

Moves files or renames directories. DR-DOS used a separate command for renaming directories.

MSAV

Runs Microsoft Anti-Virus, which first shipped with MS-DOS 6.0 in 1993, and was last used in MS-DOS 6.22. There was also a Windows 3.1 front-end for it called MWAV. The utility was actually a licenced version of Central Point Anti-Virus. It did not provide any facility for automatic virus signature updates, so users would need to download these from the BBS (bulletin board system). See also VSAFE.

MSBACKUP

Runs Microsoft Backup, a file backup and restore utility first shipped with MS-DOS 6.0. Prior to this, MS-DOS came with a very rudimentary utility called BACKUP. There was also a Windows 3.1 front-end called MWBACKUP provided with MS-DOS 6.0 and up.

MSCDEX

Short for 'Microsoft CD-ROM Extensions', MSCDEX, it is a driver executable which allows DOS programs to recognize, read, and control CD-ROMs. Unlike other storage media used by MS-DOS, optical drives such as CD-ROM drives were not automatically recognised by the operating system. Typically, a device driver provided by the drive's manufacturer would need to be loaded via a DEVICE= line in your CONFIG.SYS file, followed by running the MSCDEX.EXE file in your AUTOEXEC.BAT file.

MSD

The MSD command provides detailed technical information about the computer's hardware and software. MSD was new in MS-DOS 6;the PC DOS version of this command is QCONFIG. The command appeared first in Word2, and then in Windows 3.10.

NLSFUNC

Loads extended nationalization and localization Support from COUNTRY.SYS, and changes the codepage of drivers and system modules resident in RAM. It first came with MS-DOS 3.3.

PATH

Displays or sets a search path for executable files.

PAUSE

Suspends processing of a batch program and displays the message 'Press any key to continue. . .', if not given other text to display.

POWER

From MS-DOS 6.0 and above, the POWER utility is used to turn power management on and off, report the status of power management, and set levels of power conservation.

PRINT

The PRINT command adds or removes files in the print queue. This command was introduced in MS-DOS version 2. Before that there was no built-in support for background printing files. The user would usually use the copy command to copy files to LPT1.

PROMPT

Used to change the command prompt string, e.g. C:\. The default is $p, which displays the current drive and path. Available in MS-DOS 2.0 and above.

QBASIC

From the very first version of MS-DOS, a BASIC language interpreter was included, and early IBM PCs booted directly into this if no floppy disk was detected at boot time, loading the BASIC program from a ROM. From MS-DOS 5.0, the BASIC.EXE program was replaced with the more functional QBASIC IDE (integrated development environment) and interpreter.

RD (or RMDIR)

Remove a directory (delete a directory); by default the directories must be empty of files for the command to succeed.

RECOVER

A primitive file system recovery tool in the event your file system has been hopelessly corrupted.

REM

Remark (comment) command, normally used within a batch file, and for DR-DOS, PC/MS-DOS 6 and above, in CONFIG.SYS. This command is processed by the command processor. Thus, its output can be redirected to create a zero-byte file. REM is useful in logged sessions or screen-captures. One might add comments by way of labels, usually starting with double-colon (::). These are not processed by the command processor.

REN (or RENAME)

The REN command renames a file. Unlike the MOVE command, this command cannot be used to rename subdirectories, or rename files across drives. Mass renames can be accomplished by the use of the wildcards characters asterisk (*) and question mark (?).

REPLACE

The REPLACE command is used to replace one or more existing files or add new files to a target directory. It existed from MS-DOS 3.2 and up.

RESTORE

RESTORE was the restore portion of the BACKUP command. It was replaced from MS-DOS 6.0 onwards with the MSBACKUP utility.

SCANDISK

Disk diagnostic utility. Scandisk was a replacement for the chkdsk utility, starting with later versions of MS-DOS. Its primary advantages over chkdsk is that it is more reliable and has the ability to run a surface scan which finds and marks bad clusters on the disk. It also provided mouse point-and-click TUI, allowing for interactive session to complement command-line batch run. chkdsk had surface scan and bad cluster detection functionality included, and was used again on Windows NT based operating systems.

SET

Sets environment variables. WIth no command-line arguments it displays all current environment variables and their contents.

SETVER

SetVer is a TSR program designed to return a different value to the version of DOS that is running. This allows programs that look for a specific version of DOS to run under a different DOS.

Setver appeared in MS-DOS 4.0, and has been in every version of DOS, OS/2 and Windows NT since.

SHARE

Installs support for file sharing and locking capabilities.

SMARTDRV

Available in MS-DOS 4.01 and up, SMARTDRV was a disk caching utility, useful for speeding up disk access by copying frequently used data into RAM. Due to the importance of retaining as much conventional memory as possible available for DOS applications, SMARTDRV used extended (XMS) or expanded (EMS) memory for its cache store. Version 3.0 of SMARTDRV was included with Windows 3.0 and added double-buffering. Version 4.0, shipped with Windows 3.1 changed SMARTDRV to be an executable rather than having to be loaded via a DEVICE= line in CONFIG.SYS, and automatically attempted to load into the high memory area (HMA).

SORT

A filter to sort lines in the input data stream and send them to the output data stream. Similar to the Unix command sort. Handles files up to 64k. This sort is always case insensitive.

SUBST

A utility to map a subdirectory to a drive letter.The opposite can be achieved via the JOIN command. commands the drive letter to main.

SYS

A utility to make a volume bootable. Sys rewrites the Volume Boot Code (the first sector of the partition that SYS is acting on) so that the code, when executed, will look for IO.SYS. SYS also copies the core DOS system files, IO.SYS, MSDOS.SYS, and COMMAND.COM, to the volume. SYS does not rewrite the Master Boot Record, contrary to widely held belief.

TIME

Display the system time and waits for the user to enter a new time. Complements the DATE command.

TREE

It is an external command, graphically displays the path of each directory and sub-directories on the specified drive.

TRUENAME

The TRUENAME command will expand the name of a file, directory, or drive, and display the result. It will expand an abbreviated form which the command processor can recognise into its full form. It can see through SUBST and JOIN to find the actual directory.

MS-DOS can find files and directories given their names, without full path information, if the search object is on a path specified by the environment variable PATH. For example, if PATH includes C:\PROGRAMS, and file MYPROG.EXE is on this directory, then if MYPROG is typed at the command prompt, the command processor will execute C:\PROGRAMS\MYPROG.EXE. In this case,

TRUENAME MYPROG  

would display

C:\PROGRAMS\MYPROG.EXE  

This command displays the UNC pathnames of mapped network or local CD drives. This command is an undocumented DOS command. The help switch "/?" defines it as a "Reserved command name". It is available in MS-DOS 5.00.0. This command is similar to the Unix which command, which, given an executable found in $PATH, would give a full path and name. The C library function realpath performs this function. The Microsoft Windows command processors do not support this command. <real code.st>

UNDELETE

Restores file previously deleted with del. By default all recoverable files in the working directory are restored; options are used to change this behavior. If the MS-DOS mirror TSR program is used, then deletion tracking files are created and can be used by undelete.

UNFORMAT

Used to recover files that have been deleted from a disk via the FORMAT command. It was shipped with MS-DOS 5.0 and up.

VER

An internal DOS command, that reports the DOS version presently running, and since MS-DOS 5, whether DOS is loaded high. The corresponding command to report the Windows version is winver. Values returned:

  • MS-DOS up to 6.22, typically derive the DOS version from the DOS kernel. This may be different from the string it prints when it starts.
  • PC DOS typically derive the version from an internal string in command.com (so PC DOS 6.1 command.com reports the version as 6.10, although the kernel version is 6.00.)
  • DR-DOS reports whatever value the environment variable OSVER reports.
  • OS/2 command.com reports an internal string, with the OS/2 version. The underlying kernel here is 5.00, but modified to report x0.xx (where x.xx is the OS/2 version).
  • Windows 9x command.com report a string from inside command.com. The build version (e.g. 2222), is also derived from there.
  • Windows NT command.com reports either the 32-bit processor string (4nt, cmd), or under some loads, MS-DOS 5.00.500, (for all builds). The underlying kernel reports 5.00 or 5.50 depending on the interrupt. MS-DOS 5.00 commands run unmodified on NT.
  • The Winver command usually displays a Windows dialog showing the version, with some information derived from the shell. In windows before Windows for workgroups 3.11, running winver from DOS reported an embedded string in winver.exe.

VERIFY

Enables or disables the feature to determine if files have been correctly written to disk. If no parameter is provided, the command will display the current setting.

VOL

Displays the volume label of a disk or logical drive on your hard disk. Volume labels were added in MS-DOS 4.0 and up. See also the LABEL command.

VSAFE

VSAFE was part of Microsoft AntiVirus (MSAV). VSAFE is a memory-resident program that when loaded, monitors all disk accesses for viruses and displays a warning when it finds one.

XCOPY

Copy entire directory trees. Xcopy is a version of the copy command that can move files and directories from one location to another.