You are on page 1of 23

List of DOS commands

From Wikipedia, the free encyclopedia Jump to: navigation, search Wikibooks has a book on the topic of Guide to Windows Commands

• • • •

1 Resident and transient commands 2 Command line arguments 3 Windows command prompt o 3.1 Command line help 4 Commands o 4.1 append o 4.2 assign o 4.3 attrib o 4.4 backup and restore o 4.5 BASIC and BASICA o 4.6 Call o 4.7 cd or chdir o 4.8 chcp o 4.9 chkdsk o 4.10 choice o 4.11 cls o 4.12 copy o 4.13 ctty o 4.14 defrag o 4.15 del or erase o 4.16 deltree o 4.17 dir o 4.18 echo o 4.19 edit o 4.20 edlin o 4.21 exe2bin o 4.22 exit o 4.23 fastopen o 4.24 fc or comp o 4.25 fdisk o 4.26 find o 4.27 format

• • •

4.28 help 4.29 intersvr & interlnk 4.30 join 4.31 label 4.32 loadfix 4.33 loadhigh, lh 4.34 md or mkdir 4.35 mem 4.36 memmaker 4.37 mode 4.38 more 4.39 move 4.40 msd 4.41 path 4.42 pause 4.43 pcpark 4.44 print 4.45 rd or rmdir 4.46 rem 4.47 ren 4.48 scandisk 4.49 set 4.50 setver 4.51 share 4.52 smartdrive 4.53 sort 4.54 subst 4.55 sys 4.56 time and date 4.57 tree 4.58 truename 4.59 type 4.60 undelete 4.61 Ver 4.62 verify 4.63 xcopy 5 See also 6 References
o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o

7 External links

In the personal computer operating systems MS-DOS and PC-DOS, a number of standard system commands were provided for common tasks such as listing files on a disk or moving files. Some commands were built-in to the command interpreter, others existed as transient commands

Spaces. When the user types a line of text at the operating system command prompt. [edit] Resident and transient commands The command interpreter for MS DOS runs when no application programs are running. TIME (display or set time). DATE (display or set date). Some DOS commands carry out functions equivalent to those in a UNIX system but always with differences in details of the function. and symbols such as a "/" or a "-" may be used to allow the command processor to parse the command line into file names. or other parameter strings. COMMAND. [edit] Command line arguments Main article: Command-line interface Parts of an MS DOS command line. ERASE or DEL (erase a file or directory). showing a system prompt.loaded into memory when required. In the list below. Such utility programs would be stored on disk and loaded just like regular application programs. can be supplied on the command line. it is said to accept a filespec parameter. but were distributed with the operating system.COM. drive letters.COM. and other options. Other programs were too large to keep in the command processor. or were less frequently used. Additionally. an error message is printed and the command prompt is refreshed. either on the current logged-in floppy drive or on the command path set in the command interpreter. if the memory used for the command interpreter was overwritten. MD (make a directory on the current disk). The command interpreter is usually stored in a file called "COMMAND. the functions DIR (list directory). Some commands are built-into COMMAND. REN (rename a file or directory) and some others were resident in COMMAND. after an application exits. commands were added for the additional functions of the operating system. when a command can accept more than one filename. and attempt to match a command name to a built-in command or to the name of an excecutable program file or batch file on disk. MS DOS will re-load the command interpreter from disk storage. . Typically.COM". or a filename including wildcards (* and ?). COPY (copy files). In the current Microsoft Windows operating system a text-mode command prompt window can still be used. Resident commands varied slightly between revisions of MS DOS. If no match is found.COM will parse the line. file specifications. command and command line arguments. Commands that can accept only a single filename are said to accept a filename parameter. Over the several generations of MS DOS. zero or more command line switches. CD (change working directory). file spec with wildcard character and command line switches. Copies of these utility command programs had to be on an accessible disk.

they are usually similar to their MS-DOS equivalents. but do not require file specifiers to match case. [edit] Commands . unlike Unix. invoke commands and other tasks. Two command-line interfaces can be used in current versions of Microsoft Windows. File and path names used as arguments may be long.) some differ in command syntax or name. [edit] Windows command prompt Microsoft Windows supports a number of commands which may be invoked by typing them in a command window. etc.3 names.exe. to get help for the xcopy command. The Windows Console Command Interpreter. Often parameters or arguments are also independent of case. PCDOS. To get help on a DOS command. and may contain embedded spaces. providing access to the functions of the MS-DOS commands. is a native Windows Process that provides the functionality built in the old DOS unlike MS-DOS 8. For some commands. lower-case and capital letters are equivalent for file name specifiers. type the following at the DOS prompt: xcopy /? The operating system will execute the command and the /? parameter instructs the command to display a help page about itself. To view this help page. a UNIX command with similar functions is given. cmd. The old DOS command. Utility programs that also have versions running under UNIX-like operating systems often use upper and lower case arguments to mean different things. names with spaces must be enclosed between a pair of double-quote characters (").com and a much extended syntax to run. very early versions of DOS made the setting of the delimiter character a user-controlled option. [edit] Command line help In versions 5 of DOS and later. Commands which are not built into the command interpreter may follow the same conventions. in this case xcopy. Comparisons are approximate. Since this 16-bit executable is based on the DOS command. DR-DOS. For example. see the xcopy entry on this page. FreeDOS. While many commands are the same across many DOS systems (MS-DOS. Sometimes a hyphen ("-") may be used instead of a slash ("/"). the user can get help by typing help at the shell prompt. it does not support all the extended file name syntax of Windows. Typing help followed by a carriage return at a command prompt will list the commands. Windows applications and other Windows executables can be started. the command-line switch /? can be used.In DOS interpreter is similar to that used by the original DOS systems. DOS commands preserve case. especially in those programs developed only for DOS.

Read-only o A .Hidden o /D .A partial list of the most common commands for DOS follows.Process folders as well.][d:]path[. . ATTRIB [+R|-R] [+A|-A] [+S|-S] [+H|-H][drive:][path][filename] [/S [/D]] Options: • • • To add an attribute attach a '+' in front of it. append. It defaults to displaying the attributes of all files in the current directory.. The command is available in MS-DOS 5..System o H .] append [/X:on|off][/E] [edit] assign The command redirects requests for disk operations on one drive to a different drive.. such as allowing non-CD based games to be run from the CD.shail [edit] attrib Change or view the attributes of one or more files. This had some creative uses. /STATUS Displays the current drive assignments.Archive o S . append [d:]path[. To remove an attribute attach a '-' in front of it Attributes include o R . DOS will search the specified path(s) if the file is not found in the current path. assign [x[:]=y[:][.]] assign /STATUS Options: • • • x The drive letter to reassign. with configuration/save files stored on the HD. [edit] append Display or sets the search path for data files. If typed without parameters then all drive letters are reset to original assignments. y The drive letter that x: will be assigned to.00..

and in OS/2 (2.o /S . [edit] backup and restore Programs to back up and restore files from an external as loaders for GW-BASIC. Note: Everything inside a brace [option] is an optional item.02. Microsoft released GW-BASIC for machines with no ROM-BASIC.0 and later). these were replaced by commercial programs (CPBACKUP. In DOS 6. which allowed for extra memory in the code area. IBM computers had BASIC 1. BASICA last appeared in IBMDOS 5. and continued to PC-DOS 5 and MS-DOS 6 (PC-DOS 7 had a deversioned check). Syntax: call [filespec][batch file parameters] • • filespec: name and if necessary path of the new batch file parameters: switches [edit] cd or chdir Change current working directory. which allowed files to be restored to different locations. and IBM's versions of BASIC used code in this ROM-BASIC. Displays the current working directory when used without a path and basica. Roughly equivalent to the Unix commands chattr and lsattr. the version had ROMBASIC moved into the program code.Process matching files in the current folder and all subfolders. MSBACKUP). [edit] BASIC and BASICA An implementation of the BASIC programming language for PCs. [edit] Call Calls one batch program from another.EXE.1 in ROM. These appeared in version 2. A new batch file context is created with the specified arguments and control is passed to the statement after the label specified. cd directory . Some OEM releases had basic. cd displays the current working directory on the current drive.

[edit] chcp Changes the code page used to display character glyphs in a console window. changes the working directory to the parent directory (up one directory level).. floppy disk. or pwd (without a parameter). [edit] chkdsk Verifies a storage volume (hard disk. . cd . chdir e:directory changes the working directory on E: to directory. changes to the parent directory. cd \ changes the working directory to the root (top level) directory of the current drive. etc) for file system integrity. Equivalent to the Unix command cd (with a path parameter). Options: • • • • /F : Fixes errors on the volume (without /F . flash drive. chkdsk only detects errors) /P : Forces a full verification /R : Searches for defective sectors and recovers legible information (applies /F) /X : Unmounts the volume before processing if needed. the command displays the currently active codepage.. Without a parameter. chcp [codepage] With a numeric parameter. this command changes the codepage setting to codepage. cd . partition. (Note: Unmounting temporarily invalidates all pointers/handlers to the volume until process is completed) chkdsk volume letter: [[path]filename] [/F] [/P] [/R] [/X] Equivalent to the Unix command fsck [edit] choice Allows for batch files to prompt the user to select one item from a set of single-character choices.changes the working directory on the current drive to directory.

Examples of usage: copy con filename.03. copy file con outputs file to the screen ("console").txt copy /b alpha. e. the destination must be a directory.mpg gamma. For example. Syntax: be copy from [source\filename] to [destination\folder] Files may be copied to devices. For example.[2] Earlier versions of DR-DOS supported this function with the switch command (for numeric choices) or by beginning a command with a question mark.g. Device files may be copied in Unix as well. Syntax: ctty device • device: The terminal device to be used.extension Everything typed at the console is sent to the file. stopping when EOF (Ctrl+Z) is typed. [edit] copy Copies files from one location to another. If multiple source files are indicated. copy will stop when it reaches the EOF character. Files may be concatenated using +.[2] [edit] cls cls Clears the screen.Introduced in MS-DOS 6. cp file /dev/tty will display a file on the screen (but cat file is more commonly used here). Equivalent RT-11/RSX-11/OpenVMS command is copy. ignoring EOF characters. or an error will result. which can also done using type file. /a (text mode.[1] DR-DOS 7. copy file lpt1 sends the file to the printer on LPT1. Example of usage: . Equivalent to the Unix clear. There are two switches to modify the command's behaviour. The destination defaults to the current directory. Devices themselves may be copied: copy con file takes the text typed into the console and puts it into file. copy file1+file2 file_cat will concatenate the files and output them as file_cat.txt gamma.txt + beta.mpg + beta. the files will be concatenated in their entirety. [edit] ctty Defines the device to use for input and output. Examples of usage: copy /a alpha. the default) and /b (binary mode). in binary mode. until a control Z character is typed. In text mode.mpg Equivalent Unix commands are cp (for copying) and cat (for concatenation).

Normally. it will ask for confirmation of such a drastic action. tells the deltree command to carry out without first prompting for confirmation.ctty COM1 hello [edit] defrag (in MS/PC-DOS. diskopt in DR-DOS) Defragments a disk drive. if present.* /s all files in current folder and sub folders. [edit] del or erase Deletes one or more files.* All files in current folder *. Equivalent in RT-11/RSX-11/OpenVMS operating systems line is delete command which can be contracted to del. deltree [/y] directory The /y parameter. This command is used to delete a particular or more files. Equivalent to the Unix command rm. [edit] deltree Deletes a directory along with all of the files and subdirectories that it contains. Options: • • • • -A -F -V -H – Analyses the fragmentation of a disk drive – Force defragmentation even if disk space is low – Verbose output mode – Defrag hidden files defrag driveletter: -a -v Example of usage: No Unix equivalent. . Syntax: del filename erase filename Options *.

The dir command typed by itself. The prefix .negates an attribute. the file size in bytes. dir [drive:][path][filename] [parameters] Most commonly used parameters of dir include: • • • • • • • : Displays the listing in wide format. D (date and time). including the filename extension. and the total number of files listed. R (read-only files).(c:\dir > c:\fileList. [edit] dir Lists the contents of a directory. Deleting a non-empty directory in those versions of Windows where the command is not included. The command is one of the few commands that exist from the first versions of DOS. it is output redirection) /W Possible attributes for the A parameter are D (directories).3 : Displays the owner of each file . H (hidden files).g. attributes can be combined (e. The prefix . can be achieved by using the rmdir command as in the following example: rmdir /s [/q] directory In Unix. and the date and time the file was last modified. the functionality of deltree is provided by the rm command with the parameter -r (or -rf for the /y switch). S (size).reverses the order.The deltree command is not included in recent Microsoft Windows operating systems. /P : Pause at every page /S : Also look in subdirectories /Axx: Display files with the specified attributes only /Oxx: Modifies sort order /B : Uses bare format (no heading information or summary) > [drive:][path][filename] : To Store Result in a text file. Other less commonly used parameters of dir include: • • • • /D /L /N /Q : Display wide format but sorted by column : Display forced into lowercase : Display forced into long file name format instead of 8. their cumulative size.txt) (this is not a parameter. with as many as five filenames or directory names on each line. Possible sort orders are N (name). E (extension). and G (group directories first). /A:DA means directories with the archive bit on). and the free space (in bytes) remaining on the disk. displays the disk's volume label and serial number. and S (system files). A (last access date). one directory or filename per line. A (files/directories with the archive bit on).

• /X : Display shows 8. included with MS-DOS 5 and 6. but the output of echo can be redirected like any other command. it works the opposite way from /w. this means directly to the screen.0 PC-DOS 6 and later use the DOS E Editor. Equivalent to the Unix command echo.) Equivalent in RT-11/RSX-11/OpenVMS operating systems line is directory command which can be contracted to dir.0 • • Windows 95 and later. Traditionally batch 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.3 names next to long file names The default parameters of dir can be set using the DIRCMD environment variable. Outputs 'this is text' Outputs a blank line echo this is text echo. OS/2 and Windows NT to 4. Usually. again by redirecting the output stream: To type more than one line from the console into a file. use copy con (above). The @ symbol declares that this particular command (echo off) should also be executed without echo. echo on echo off Another important use of the echo command is to toggle echoing of commands on and off in batch files.bat: @echo The files in your root directory: @dir /b /a-d c:\ Echo can be used to write to files directly from the console.bat: turns on echoing of commands turns off echoing of commands files begin with the @echo off statement. For example the following 2 batch files are equivalent: Batch1. @echo off echo The files in your root directory: dir /b /a-d c:\ Batch2. . Equivalent to the Unix command ls (the option -l is "long" list format. by redirecting the output stream: echo text > filename echo text >> filename Echo can also be used to append to files directly from the console. Often used in batch files to print text out to the user. [edit] edit Full-screen text editor. [edit] echo Prints its own arguments back out to the DOS equivalent of the standard output stream. and W2k and later use Edit v 2.

In DOS 5. . it has no effect unless in a DOS window under Microsoft Windows. like debug. If the exit is used at the primary command. The size of the resident code and data sections combined in the input . it will logoff the user. it's on the supplemental disks.exe) file into a binary file with the extension . [edit] exit Exits the current command processor. /LBn Sets the maximum consecutive mismatches to the specified number of lines. /B Performs a binary comparison. [edit] fastopen Main article: FASTOPEN [edit] fc or comp Compares two files or sets of files and displays the differences between however. DOS 6 was the last version to contain EDLIN. If an exit command is used in the primary command shell under Unix. and OS/2 have Edlin. Windows NT 32-bit. /T Does not expand tabs to spaces. in which case the window is closed and the user returns to the desktop. It can be used with a script file. /C Disregards the case of letters. PC-DOS 6 had it in the base install. The absence of a console editor in MS/PC-DOS 1-4 created an after-market for third-party editors. this makes it of some use even today. which is a memory image of the program. The file must also have no stack segment. similar to the control-D keystroke.• DR-DOS used editor up to version 7. for MS-DOS 6. /L Compares files as ASCII text. an extra command "?" was added to give the user much needed help.exe file must be less than 64KB. exit [/B] /B When used within a batch script. /W Compresses white space (tabs and spaces) for comparison. [edit] edlin DOS line-editor. [edit] exe2bin Converts an executable (. exits the script without closing the calling DOS window Exit also exists in Unix-shells. FC [/A] [/C] [/L] [/LBn] [/N] [/T] [/W] [/nnnn] [drive1:][path1]filename1 [drive2:][path2]filename2 FC /B [drive1:][path1]filename1 [drive2:][path2]filename2 /A Displays only first and last lines for each set of differences. /N Displays the line numbers on an ASCII comparison.

: "C:\FDISK /MBR D:" would install boot record on D:\ Fdisk exists under Unix with the same name. When run from the command line. find "keyword" < ''inputfilename'' > ''outputfilename'' Searches for a text string in a file or files. [edit] fdisk Manipulates hard disk partition tables.. Create DOS partition or Logical DOS Drive 2.]] /V Displays all lines NOT containing the specified string. e. Delete partition or Logical DOS Drive 4. "string" Specifies the text string to find. partition. [drive:][path]filename Specifies a file or files to search. but it is an entirely different program. [edit] format ./nnnn Specifies the number of consecutive lines that must match after a mismatch.g. FIND searches the text typed at the prompt or piped from another command. /I Ignores the case of characters when searching for the string. If a pathname is not specified. The Unix command find performs an entirely different function analogous to dir /s. /N Displays line numbers with the displayed lines. Find may also be used as a pipe. [drive1:][path1]filename1 Specifies the first file or set of files to compare. Set active partition 3. [drive2:][path2]filename2 Specifies the second file or set of files to compare. FIND [/V] [/C] [/N] [/I] "string" [[drive:][path]filename[ .. However they share purposes. it displays a menu of various partitioning operations: 1. [edit] find 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. Completes above command on indicated partition. Display partition information 5.[citation needed] Equivalent to the Unix commands comm. Equivalent to the Unix command grep. FDISK /MBR #: where # is other partition on system. The name derives from IBM's habit of calling hard drives fixed disks. /C Displays only the count of lines containing the string. Change current fixed disk drive (only available if the computer has more than one hard drive) FDISK /MBR installs a standard master boot record on the hard drive. cmp and diff.

2. uses DOS 5 style help. /C Tests clusters that are currently marked "bad. with some hyperlinking etc. dosbook. 1. 320.INF) in a similar style to MS-DOS 6.HLP file. MS-DOS help 'command' would give help on a specific command. it lists the contents of DOSHELP. [edit] help Gives help about DOS. The MS-DOS 6.xx help uses view. DR-DOS In DR-DOS. /Q Performs a quick format. In MS-DOS 6.HLP. Equivalent in RT-11/RSX-11/OpenVMS operating systems line is format command which can not create filesystem.exe to open OS/2 style . This is now an official switch in Windows Vista and 7 but with the parameter /p instead. By itself.INF files (cmdref. which contains more extensive information on the commands. /1 Formats a single side of a floppy disk.HLP or NTCMDS.x this command exists as FASTHELP. Microsoft Windows Windows NT. 2. PC-DOS PC-DOS 7.inf and doserror.25-inch 360K floppy disk in a high-density drive. /F:size Specifies the size of the floppy disk to format (such as 160. /autotest and /backup are undocumented features. /T:tracks Specifies the number of tracks per disk side. Help for a specific command invokes the command with the /? option.88). all versions. Equivalent to the Unix command mkfs. MS-DOS 6. 720. help is a batch file that launches DR-DOS' online reference.44. /B Allocates space on the formatted disk for system files. but versions before VISTA have also a Windows help file (NTCMDS. dosrexx. /8 Formats eight sectors per track. /S Copies system files to the formatted disk. 1.22 help system is included on Windows 9x cdrom versions as well. This command can potentially erase everything on a computer's hard disk. 360.inf). . /N:sectors Specifies the number of sectors per track." There is also an undocumented /u parameter for "unconditional" that will write strings of zeros on every sector. /4 Formats a 5. Both will format the drive without a confirmation prompt.xx help command uses QBASIC to view a quickhelp HELP. this should only be used on floppy drives or other removable media. After formatting one should use initialize (contracted to init) command to create filesystem (Equivalent to MS-DOS command format /q or "quick format").Delete all the files on the disk and reformat it for MS-DOS In most cases.inf. format [options] drive FORMAT drive: [/V[:label]] [/Q] [/F:size] [/B | /S] [/C] FORMAT drive: [/V[:label]] [/Q] [/T:tracks /N:sectors] [/B | /S] [/C] FORMAT drive: [/V[:label]] [/Q] [/1] [/4] [/B | /S] [/C] FORMAT drive: [/Q] [/1] [/4] [/8] [/B | /S] [/C] /V[:label] Specifies the volume label. opening these to the appropriate pages. 180.

New in PC-DOS 5. to block the lower 64K of memory. lh Main article: loadhigh hiload in DR-DOS.[4] [edit] loadhigh. The server-side version of InterLnk. default path is \HELP on the drive which HELP is placed. Partially equivalent to the Unix command man. [edit] md or mkdir .[3] JOIN d: [d:\path] JOIN [/D] (removes drive assignment) If JOIN a: c:\floppy were executed. e2label can be used for ext2 partitions. The opposite can be achieved via the subst command. filelink in DR-DOS) Network PCs using a null modem cable or LapLink cable. [edit] loadfix Loads a program above the first 64K of memory.FreeDOS FreeDOS uses an HTML help system. which opened or closed lower. The path is stored in HELPPATH environment variable. upper.02. c:\floppy would display the contents of the a: drive. if not specified. though some Unices offer the ability to network computers with TCP/IP through null modem or Laplink cables using PLIP or SLIP. and runs the program. [edit] join Attaches a drive letter to a specified directory on another drive. [edit] intersvr & interlnk (in MS-DOS. DR-DOS' filelink is executed on both the client and server.0[3] No direct Unix equivalent. DR-DOS used memmax. [edit] label Changes the label on a logical drive. which views HTML help files on a specified path. 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. this differs from filesystem to filesystem. loadfix [drive:][path]filename Included only in MS/PC-DOS. In Unix and Unix-like systems. such as a hard disk partition or a floppy disk. and video memory access. MS-DOS 6.

internal drivers. MS-DOS included the external program MemMaker which was used to free system memory (especially Conventional memory) by automatically reconfiguring the AUTOEXEC. The parent of the directory specified will be created if it does not already exist. and sets up port redirection. /UNDO Instructs MemMaker to undo its most recent changes. Better results could be achieved by an experienced user manually configuring the startup files to achieve greater free memory yield. [edit] mode Configures system devices. provides a summary of memory in use and lists largest memory block available. The whole process required three system restarts.[5] . MemMaker takes the default action at all prompts. Changes graphics modes. /DEBUG or /D . The use of MemMaker was popular among gamers who wanted to enable or disable Expanded memory in order to run a game which required EMS or not. /PROGRAM or /P Displays status of programs currently loaded in memory. mem Options: • • • /CLASSIFY or /C . This was usually done by moving TSR Programs to the Upper memory.Lists the size of programs. [edit] memmaker Starting from version 6. md directory Equivalent to the Unix command mkdir. [edit] mem Displays memory usage. In batch mode.Makes a new directory. and other information. Equivalent to the Unix command free.SYS files.Displays status of programs. Options: • • /BATCH Runs MemMaker in batch (unattended) mode. adjusts keyboard settings. PC-DOS uses another program RamBoost to optimize memory. either the HIMEM/EMM386 or a third-party memory manager.BAT and CONFIG. Before the first restart the user was asked whether he/she wanted to enable EMS Memory or not. prepares code pages.

however in GNU/Linux similar type of information may be obtained from various text files in /proc directory. only used on early versions. . DR-DOS used a separate command for renaming directories. msd New in MS-DOS 6. rendir. [edit] msd Main article: Microsoft Diagnostics Provides detailed technical information about the computer's hardware and software. [edit] pcpark Parks the hard disk heads in order to enable safe shutdown.[6] the PC-DOS version of this command is QCONFIG. more < inputfilename [edit] move Moves files or renames directories. Equivalent to the Unix commands more and less. MS-DOS 3. move filename newname move driveletter:\olddir driveletter:\newdir Example of usage: move c:\old c:\new Equivalent to the Unix command mv. [edit] path Displays or sets a search path for executable files.'. . pcpark No Unix equivalent. [edit] pause Suspends processing of a batch program and displays the message 'Press any key to continue. . More may also be used as a filter.2 (and possibly others) used the command HHSET [edit] print Adds a file in the print queue.[citation needed] No Unix equivalent.[edit] more command | more Pages through the output so that you can view more than one screen of text.

For example.txt filey. this functionality of a simple move is provided by the mv command. while batch renames can be done using the rename command. In these cases double-quotes are used to enclose them: ren c:\"Documents and Settings"\"All Users"\Desktop filex. rd directory [edit] rem Remark statement. rem > newfilename In Unix. Equivalent to the Unix command rmdir. You can rename files in another directory by using the PATH parameter: ren [path]|[filename] [newfilename] ren c:\Windows filex. . Before that there was no built-in support for background printing files. An alternative way not to run a specific statement in a batch file is creating a label that will never be used. sign can be used to start a comment. [edit] rd or rmdir Remove a directory. Default value is LPT1 /P filename : Add files in the print queue /T : Removes all files from the print queue /C filename : Removes a file from the print queue This command was introduced in MS-DOS version 2.Options: • • • • /D device : Specifies the name of the print devices. The user would usually use the copy command to copy files to LPT1. the following command will change the extension of all files in the current directory which currently have the extension htm to html: In Unix.html Mass renames can be accomplished by the use of wildcards. the # [edit] ren Renames a file.txt ren filename newname An example could be: On DOS with long filename support. which by default must be empty of files for the command to succeed (the /s flag removes this restriction). or rename files across drives.txt ren *. this command cannot be used to rename subdirectories. Unlike the move command. care must be taken when directories have spaces in their names like "Documents and Settings".htm *. Equivalent to the Unix commands lp and lpr.txt filey. normally used within a batch file. ::.

Handles files up to 64k. share [/F:space] [/L:locks] /F:space Allocates file space (in bytes) for file-sharing information. had surface scan and bad cluster detection functionality included. allowing for interactive session to complement command-line batch run. See Environment variable. This sort is always case insensitive. Since Windows 2000. /L:locks Sets the number of files that can be locked at one time. and was used again on Windows NT based operating systems. OS/2 and Windows NT since. [edit] smartdrive Main article: SmartDrive [edit] sort A filter to sort lines in the input data stream and send them to the output data stream.[edit] scandisk Disk diagnostic utility. echo You typed: "%choice%" [edit] setver TSR designed to return a different value to the version of DOS that is running. it can even be used for command line inputs by using Parameter /P set /p choice=Type your text. 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. Setver appeared in version 4. Scandisk was a replacement for the chkdsk utility. sort < inputfilename > outputfilename Similar to the Unix command sort. It also provided mouse point-and-click TUI. [edit] share Installs support for file sharing and locking capabilities. starting with later versions of MS-DOS. [edit] set Sets environmental variables. chkdsk Equivalent to the Unix command fsck. This allows programs that look for a specific version of DOS to run under a different DOS. [7] . and has been in every version of DOS.

Users with superuser privileges may use date -s <new-datetime> to change the time and date. will look for Io. Io. [edit] tree Shows the directory tree of the current directory Syntax: tree [options] [directory] Options: • • • /F (Displays the names of the files in each folder.) /A (Use ASCII instead of the extended characters. to the and Command. [edit] sys A utility to make a volume bootable. when executed. The Unix command time performs a different function. contrary to widely-held belief. they will display the time or date and wait for the user to type a new time or date and press RETURN. a new drive A utility to map a subdirectory to a drive letter. Sys also copies the core DOS system files. showing the contents of c:\edrive.sys. Sys rewrites the Volume Boot Code (the first sector of the partition that Sys is acting on) so that the code.sys. [edit] time and date time date Display and set the time and date When these commands are called from the command line or a batch file. The Unix command date displays both the time and date. The command 'time /t' will bypass asking the user to reset the time. Sys does NOT rewrite the Master Boot Record.sys. The opposite can be achieved via the join command.[edit] subst subst <d:> <path> subst <d:> /D (Deletes the substitute drive) If SUBST e: c:\edrive were executed.[3] letter e: would be created. but does not allow the normal users to change either. Msdos.) /? (Shows the help) [edit] truename truename or truename drivename or truename filename or truename directory .

TRUENAME MYPROG would display C:\PROGRAMS\MYPROG. type long-text-file | more. The more command is frequently used in conjunction with this command. type filename [edit] undelete Restores file previously deleted with del. . and file MYPROG.00. would give a full path and name.EXE and for a substituted drive set up by subst d: c:\util\test the command truename d:\test. The help switch "/?" defines it as a "Reserved command name". without full path information.exe This command also displays the UNC pathnames of mapped network or local CD drives. The options are used to change this behavior. then deletion tracking files are created and can be used by undelete. The Microsoft Windows command processors do not support this command. The C library function realpath performs this function. In the above example. This command is similar to the Unix which command. the command processor will execute C:\PROGRAMS\MYPROG. MS-DOS can find files and directories given their names. By default all recoverable files in the working directory are restored.EXE the TRUENAME command will expand a name in an abbreviated form which the command processor can recognise into its full form. This command is an undocumented DOS command.If typed without a parameter then the current active drive pathname is displayed. Syntax: undelete [filespec] [/list|/all][/dos|/dt] Options: • /list : lists the files that can be undeleted. and display the result. Equivalent to the Unix command cat. For example. It is available in MS-DOS 5. given an executable found in $PATH. if the MS-DOS mirror TSR program is used.exe will display c:\util\test\test. which. [edit] type Display a file. then if MYPROG is typed at the command prompt. It can see through SUBST and JOIN to find the actual directory. e. if the search object is on a path specified by the environment variable PATH.g.EXE is on this directory. if PATH includes C:\PROGRAMS.

[8] verify [on|off] [edit] xcopy Copy entire directory trees. Options: DOS 5 and later • • /r : revision level.11. . The underlying kernel here is 5. If no parameter is provided. OS/2 command. /dt : Recover only deletion tracking file aware files. MS-DOS 5. In Unix and Unix-like systems this differs from filesystem to (so PCDOS 6. 2222). The Winver command usually displays a Windows dialog showing the version. MS-DOS 5. that reports the DOS version presently running. The underlying kernel reports 5.xx (where x. This may be different from the string it prints when it starts.00 or 5. and since MS-DOS• • • /all : Recovers all deleted files without prompting. PC-DOS typically derive the version from an internal string in command. with some information derived from the shell. although the kernel version is 6.exe. /dos : Recover only MS-DOS aware files. [edit] verify Enables or disables the feature to determine if files have been correctly written to reports the version as 6.00. Windows 9x command.00 commands run unmodified on NT. ignore deletion tracking file. running winver from DOS reported an embedded string in winver. is also derived from there.) DR-DOS reports whatever value the environment variable OSVER reports. People who use the ext2 filesystem can try the command e2undel.xx is the OS/2 version). also shows whether DOS is loaded high /? : shows command line help. the command will display the current setting. typically derive the DOS version from the DOS kernel. The corresponding command to report the Windows version is winver. with the OS/2 version. The build version (e. or under some loads. cmd). In windows before Windows for workgroups reports an internal string. but modified to report x0. Value returned: • • • • • • • MS-DOS up to 6. Windows NT reports either the 32-bit processor string ( report a string from inside command. Uses a number sign for missing first character.1 command.g.00.500. whether DOS is loaded high. (for all builds).00. [edit] Ver An internal DOS command.50 depending on the interrupt.

Xcopy is a version of the copy command that can move files and directories from one location to another. . xcopy directory [destination-directory] Equivalent to the Unix command cp when used with -r parameter.