|TDOS 4.01 Commands|T append assign attrib backup break cd chcp chdir chkdsk cls command comp copy ctty date del dir diskcomp diskcopy exe2bin exit fastopen fc fdisk find format graftabl graphics join keyb label mem mkdir mode more nlsfunc path print prompt recover ren replace restore rmdir select set share sort subst sys time tree type ver verify volume xcopy Disk functions Directory functions File functions Console functions Other functions .pg |tDisk functions|t: assign Assigns a drive letter to a different drive. backup Backs up one or |nmore|n files from one disk to another. chkdsk Checks the disk in the specified drive for errors. fdisk Configures hard disks for MS-DOS. diskcomp Compares disks. diskcopy Copies disks. format Formats a disk to receive MS-DOS files. join Joins a disk drive to a |npath|n. label Labels disks. recover Recovers a bad disk or file. select Installs MS-DOS on a new floppy disk with desired country-specific information and keyboard layout. verify Verifies all writes to a disk. volume Displays the |nvolume|n |nlabel|n. .pg |tDirectory functions|t chdir (|scd|s) Changes directories or displays the working directory dir Lists the files in a directory. fastopen Opens frequently-used files and directories quickly. mkdir Makes a directory (md). rmdir Removes a directory (rd). subst Substitutes a string for a |npath|n. sys Transfers MS-DOS system files from one drive to the drive specified. tree Displays directory and file names. .pg |tFile functions|t append Sets a search |npath|n for data files. attrib Sets or displays file attributes. comp Compares the contents of two sets of files. copy Copies the specified file(s). del Deletes the specified file(s) (erase). exe2bin Converts executable (.exe) files to binary |nformat|n. fastopen Opens frequently-used files and directories quickly. fc Compares files and displays differences between them. find Searches files for a specific string of text. print Prints files. recover Recovers a bad disk or file. ren Renames first file as second file (rename). replace Replaces previous versions of files. restore Restores backed up files. share Installs file sharing and locking. type Displays the contents of a file. xcopy Copies files and subdirectories. .pg |tConsole functions|t break Sets CONTROL+C check. chcp Displays or changes the current code page. cls Clears the screen. command Starts the |ncommand|n processor. ctty Lets you change the device from which you issue commands. exit Exits the |ncommand|n processor to the previous level. graftabl Loads a table of |ngraphics|n characters. graphics Prepares MS-DOS for printing |ngraphics|n. keyb Loads a keyboard program. more Displays output one screen at a |ntime|n. nlsfunc Loads country-specific information. path Sets a |ncommand|n search |npath|n. prompt Changes the MS-DOS |ncommand|n |nprompt|n. set Sets one string value to another in the environment, or displays the environment. .pg |tOther functions|t date Displays and sets the |ndate|n. mem Displays memory information. mode Sets operation modes for devices. sort Sorts data forward or backward. time Displays and sets the |ntime|n. ver Prints the MS-DOS version number. .pg |tAppend|t Sets a search |npath|n for data files. append [/x] [/e] First use only append [drive:]path[;[drive:] [|npath|n]...] Specifies directories to be searched. append; To delete appended paths: To suspend /x processing with the attrib, backup, dir, replace, restore, and xcopy commands: append [path] [/x[:on]] [/path:on] append [path] [/x:off] [/path:off] /x or /x:on Extends the number of executable files that use the |nappend|n directories. It allows the executable files that use exec (INT 21H, Function 4BH), search first (INT 21H, Function 11H), and |nfind|n first (INT 21H, Function 4EH) to use the |nappend|n directories. /x:off Turns off the /x search, |nfind|n, and execute operations. /e Causes appended directories to be stored in the MS-DOS environment. First |ntime|n only. /path:on Files having drives and/or paths are to be processed. /path:off Opposite of on .pg |tAssign|t Assigns a drive letter to a different drive. assign [x[=]y[ ...] ] subst preferred. |tAttrib|t Sets or displays file attributes. attrib [r] [a] [drive:]pathname [/s] +r sets the read-only attribute of a file. -r disables read-only |nmode|n. +a sets the archive attribute of a file. -a clears the archive attribute of a file. /s processes all subdirectories as well as the |npath|n specified. |tBackup|t DO NOT USE - BUGGY Backs up one or |nmore|n files from one disk to another. |tBreak|t Sets CONTROL+C check. break [on] or break [off] |tChcp|t Displays or changes the current code page chcp [nnn] nnn is the code page to start. .pg |tChdir|t Changes a directory to a different |npath|n; displays |tcd|t the working directory. chdir[path] or cd[path] |tChkdsk|t Scans the disk in the specified drive and checks it for errors. chkdsk [drive:][pathname] [/f] [/v] /f Fixes errors on the disk. /v Displays the name of each file in each directory as it checks. |tCls|t Clears the screen. cls |tCommand|t Starts a secondary |ncommand|n processor. command [drive:][path][ctty-dev] [/e:nnnnn][/p][/c string] ctty-dev allows you to specify a different device for input and output. /e:nnnnn environment size, nnnnn is the size in bytes, 160 to 32,768 /p Keeps the secondary |ncommand|n processor in memory. /c string perform the command(s) specified by string and then to return automatically to the primary |ncommand|n processor. .pg |tComp|t Compares the contents of two sets of files. comp [drive:][pathname1] [drive:][pathname2] |tCopy|t Copies one or |nmore|n files to another location, also appends files. copy [drive:]pathname1 [drive:][pathname2][/v][/a][/b] or copy [drive:]pathname1 [/v] [/a][/b][drive:][pathname2] copy pathname1 + pathname2 [...] pathnameN {append files} /v |nverify|n the sectors written on the target disk /a This switch says to read until the end-of-file mark. /b |ncopy|n number of bytes specified in the directory. |tCtty|t Lets you change the device from which you issue commands. ctty device |tDate|t Displays or sets the |ndate|n. date [mm-dd-yy] .pg |tDel|t Deletes the specified files. del [drive:]pathname/p erase [drive:]pathname /p /p Causes del or erase to |nprompt|n you before a deletion |tDir|t (Directory) Lists the files in a directory. dir [drive:][pathname][/p][/w] /p causes the directory display to pause once the screen is filled. /w Selects wide display |tDiskcomp|t Compares the contents of the disk in the source drive to the disk in the target drive. diskcomp [drive1:] [drive2:] [/l] [/8] /l Causes diskcomp to compare just the first side of the disk /8 Causes diskcomp to compare just the first 8 sectors per track .pg |tDiskcopy|t Copies the contents of the floppy disk in the source drive to a formatted or unformatted floppy disk in the target drive. diskcopy [drive1:] [drive2:] [/1] /1 allows you to |ncopy|n only one side of a disk. |tExe2bin|t Converts .exe (executable) files to binary |nformat|n. exe2bin [drive:]pathname1 [drive:]pathname2 |tExit|t Exits the |ncommand|n.com program and returns to a previous level, if one exists. exit |tFastopen|t Decreases the amount of |ntime|n needed to open frequently-used files and directories. fastopen [drive:[=n][...]] /x fastopen [drive:[=(n,m)][...]] /x or fastopen [drive:[=([n],m)][...]] /x n number of files that fastopen will work with, 10-999. m number of file extent entries for files on the drive specified. /x put cache in (LIM 4.0) expanded memory .pg |tFc|t Compares two files, or two sets of files, and displays the differences between them. For ASCII comparisons: fc [/a] [/c] [/L] [/Lb n] [/n] [/t] [/w] [/nnnn][drive:]pathname1 [drive:]pathname2 For binary comparisons: fc [/b] [/nnnn][drive:]pathname1[drive:]pathname2 /a Abbreviates the output of an ASCII comparison. /b Forces a binary comparison of both files. /c Causes the matching process to ignore the case of letters. /L Compares the files in ASCII |nmode|n. /Lb Sets the internal line buffer to n lines. /n Displays the line numbers on an ASCII comparison. /t Does not expand tabs to spaces. /w Causes fc to compress white space during the comparison. /nnnn Specifies the number of lines that must match after fc finds a difference between files. If the number of matching lines in the files is less than this number, fc displays the matching lines as differences. .pg |tFdisk|t Configures a hard disk for use with MS-DOS. fdisk |tCAUTION THIS WILL DESTROY ALL DATA ON YOUR HARD DISK!!|t |tFind|t Searches for a specific string of text in a file or files. find [/v] [/c] [/n] "string" [[drive:][pathname] ...] String is a group of characters you want to search for. If string contains quotation marks, you must enclose it in an additional pair (""string""). Wildcards are not allowed in filenames or extensions. /v Displays all lines not containing the specified string. /c Displays only the number of lines that contain a match. /n Precedes each line with its relative line number in the file. .pg |tFormat|t Formats the disk in the specified drive format drive:[/1][/4][/8][/n: sectors][/t:tracks] [/v[:label]][/s] format drive:[/1][/b][/n:sectors][/t:tracks] format drive:[/v[:label]][/f: size][/s] /1 Formats a single-side of the floppy disk. /4 Formats a 360K, DSD in a high-capacity disk drive. /8 Formats eight sectors per track. /b Formats the disk, leaving space for MS-DOS. /s Copies the operating system to the newly formatted disk. /t:tracks For 3.5 inch disks this value is 80 (/t:80). /n:sectors For a 3.5-inch 720K-byte disks, this value is 9 (/n:9). /v:|nlabel|n Specifies the |nvolume|n |nlabel|n to use. -More- .pg /f:size Specifies the size of the diskette to |nformat|n: 160K single-sided 5.25-inch: 160, 160K, 160KB 180K single-sided 5.25-inch: 180, 180K, 180KB 320K double-sided 5.25-inch: 320, 320K, 320KB 360K double-sided 3.5-inch: 360, 360K, 360KB 720K double-sided 3.5-inch: 720, 720K, 720KB 1.2M double-sided 5.25-inch: 1200, 1200K, 1200KB, 1.2, 1.2M, 1.2MB 1.44M double-sided 3.5-inch: 1440, 1440K, 1440KB, 1.44, 1.44M, 1.44MB The /n and /t options cannot be used with /f. Disk |ntype|n Valid switches 160/180 kilobytes /l /4 /8 /b /n /t /v /s /f 320/360 kilobytes /1 /4 /8 /b /n /t /v /s /f 720 kilobytes /b /n /t /v /s /f 1.2 megabytes /b /n /t /v /s /f 1.44 megabytes /b /n /t /v /s /f hard disk /b /v /s .pg |tGraftabl|t Enables an extended character set to be displayed in |ngraphics|n |nmode|n when using a color |ngraphics|n adapter (CGA). graftabl [xxx] graftabl /sta[tus] graftabl [?] xxx is a code page identification number. /sta[tus] Displays the active character set. ? Displays instructions for using the graftabl |ncommand|n. .pg |tGraphics|t Lets you |nprint|n a |ngraphics|n display screen on a printer when you are using a color or |ngraphics|n monitor adapter. graphics |ntype|n [profile] [/r] [/b] [/lcd] [/printbox:id] profile is the name of the file that contains information on all supported printers. If this is omitted, the |ngraphics|n.pro file is used. |ntype|n is one of the following: COLOR1 Prints on an IBM Personal Computer Color Printer with black ribbon. COLOR4 Prints on an IBM Personal Computer Color Printer with RGB (red, green, blue, and black) ribbon. COLOR8 Prints on an IBM Personal Computer Color Printer with CMY (cyan, magenta, yellow, and black) ribbon. |nGRAPHICS|n Prints on an IBM Personal |nGraphics|n Printer, IBM Proprinter, or IBM Quietwriter Printer. |nGRAPHICS|nWIDE Prints on an IBM Personal |nGraphics|n Printer with an 11-inch wide carriage. THERMAL Prints on an IBM PC-convertible Thermal Printer. -More- .pg /b Prints the background in color valid for COLOR4 and COLOR8 /r Prints black and white (as seen on the screen) on the printer. The default is to |nprint|n black as white and white as black. /lcd Prints an image using LCD aspect ratio instead of CGA aspect ratio. This is the same as the /printbox:lcd switch. /printbox:id Selects the |nprint|n box size. .pg |tJoin|t Joins a disk drive to a specific |npath|n. join [drive: drive:path] Create the connection. join drive: /d Delete the connection. |tKeyb|t Loads a keyboard program. keyb [xx[,[yyy],[[drive:][path]filename]]][/ID:nnn] xx is a two letter country code. yyy is the code page which defines the character set. filename is the name of the keyboard definition file. If not specified, the filename used is keyboard.|nsys|n. /ID:nnn specifies the keyboard in use. |tLabel|t Creates, changes, or deletes the |nvolume|n |nlabel|n on a disk. label [drive:][label] .pg |tMem|t Displays the amount of used and free memory, lists allocated and free memory areas, and programs that are loaded. mem [/program] mem [/debug] /program Displays programs loaded in memory. /debug Displays programs, internal drivers, and other programming information. |tMkdir|t (md) Makes a directory. mkdir [drive:]path md [drive:]path .pg |tMode|t Display device status, Configure printer, Configure serial port, |sSet display mode|s, |sSet keyboard mode|s, Set device code pages, Redirect printing |tDisplay device status|t mode[device][/sta[tus] The /sta[tus] switch is required only when requesting status for (redirected) parallel printers. |tConfigure printer|t Sets the characteristics for IBM-compatible printers connected to a parallel printer port (LPT1, LPT2, or LPT3). mode LPTn[:][c][,[l][,r]] mode LPTn[cols=c][lines= l][retry=r] n Specifies the printer number: 1, 2, or 3. c Specifies the characters per line: 80 or 132. l Specifies the vertical spacing and lines per inch: 6 or 8. -More- .pg r Specifies the retry action to take when time-out errors occur. E returns the error from a status check (default). B returns busy from a status check of a busy port. R returns ready from a status check of a busy port. NONE means no retry action is taken. The default settings are LPT1, 80 characters per line, and 6 lines per inch. .pg |tConfigure serial port|t Controls the configuration of the serial communications adapter. mode COMm[:]b,[,p[,d[, s[,r]]]] mode COMm baud=b[data=d] [stop=s][parity=p][retry=r] m Specifies COM port number: 1, 2, 3, or 4. b Specifies the first two digits of the transmission rate: 110, 150, 300, 600, 1200, 2400, 4800, 9600, or 19,200. p parity: None, Odd, Even (default), Mark, or Space. d Specifies the number of data bits: 5, 6, 7, or 8. s Specifies the number of stop bits: 1, 1.5, or 2. r retry action to take E returns an error from a status check (default). B returns busy from a status check of the busy port. R returns ready from a status check of the busy port. NONE means that no retry action is taken. The default settings are COM1, even parity, and 7 data bits. .pg |tSet display mode|t Selects the active video adapter and its display |nmode|n or reconfigures the current display. mode display, n mode [display],shift[,test] mode con [:] [cols=m][lines=n] display - one of the following: 40, 80, BW40, BW80, CO40, CO80, or MONO. shift - shift a CGA display to the left or right. values are L or R. n - number of lines on the display. values are 25, 43, and 50. m - number of characters per line. Possible values are 40 or 80. test - align the display. |tSet keyboard mode|t Set keyboard typematic rate. mode con [:] rate=r delay=d r the typematic interval |ntime|n, values are 1-32. d the auto-repeat start delay |ntime|n, 1-4 (.25 - 1.00 second) .pg |tSet device code pages|t Set or display code pages for parallel printers or your console. mode device codepage prepare=((yyy)[drive:][path]filename) mode device codepage select=yyy mode device codepage refresh mode device codepage [/status] device device to support code-page switching. CON, LPT1, LPT2, and LPT3. yyy Specifies a code page. 437, 850, 860, 863, and 865. filename - Identifies the .cpi file MS-DOS should use prepare - Tells MS-DOS to prepare code pages for a given device. select - Specifies which code page you want to use with a device. refresh - this keyword reinstates the prepared code pages. /status - Displays the current code pages prepared and/or selected |tRedirect printing|t Redirects output from a parallel port to a serial communications port. mode LPTn[:]=COMn[:] .pg |tMore|t Displays output one screen at a |ntime|n. |nmore|n < source source || |nmore|n |tNlsfunc|t Loads country-specific information. nlsfunc[[drive:][path]filename] filename - specifies the file containing country-specific information. |tPath|t Sets a |ncommand|n search |npath|n. |npath|n [drive:][path][;[drive:][path]...] |npath|n ; This |npath|n is also called the NUL |npath|n. The maximum length of a |ncommand|n search |npath|n is 127 characters. .pg |tPrint|t Prints a text file in the background. print [/d:device][/b:size][/u:value1] [/m:value2] [/s:timeslice][/q:qsize][/t][drive:][pathname][/c][/p] /d:device |nprint|n device name (LPT1, LPT2, LPT3, COM1, COM2, COM3, COM4). default=PRN. /d must be the first switch. /b:size buffer size in bytes. minimum and default value /b is 512, max is 1634. /u:value1 number of clock ticks to wait for a printer. 1-255 /m:value2 number of clock ticks to |nprint|n a character. 1 to 255. /s:timeslice interval of |ntime|n the |nprint|n |ncommand|n. 1-255 /q:qsize number of files in the |nprint|n queue. 4-32. must be used without any filenames /t Deletes all files in the |nprint|n queue /c cancel and remove the preceding filename and following filenames from the |nprint|n queue. /p starts |nprint|n and adds the preceding filename and following filenames to the |nprint|n queue. The /d, /b, /u, /m, /s, and /q switches are allowed only the first |ntime|n. Each |nprint|n queue entry may contain a maximum of 64 characters, including the drive name. .pg |tPrompt|t Changes the MS-DOS |ncommand|n |nprompt|n. prompt [[text][$character]...] $q = $$ $ $t The current |ntime|n $d The current |ndate|n $p The working directory of the default drive $v The version number $n The default drive $g The character > $l The || character $b The || character $_ CRLF $e ASCII code X'1B' (escape) $h Backspace, to erase a character .pg |tRecover|t Recovers readable information from a file or files when one or |nmore|n sectors on the disk become bad or defective. recover [drive:][path]filename USE WITH CAUTION recover drive USE WITH CAUTION |tRen|t (Rename) Changes the name of a file. ren [drive:][path]oldname newname |tReplace|t |nreplace|n target files with source files of same name replace [dr:]sourPathName1 [dr:][targPathName2] [/a][/p][/r][/s][/w][/u] /a Adds new files to the target directory instead of replacing old ones. Incompatible with the /s or /u. /p Prompts before it replaces a target /r Replaces read-only files as well as unprotected files. /s Searches all subdirectories of the target directory while it replaces matching files. This switch is incompatible with the /a switch. /u Replaces only older files. /w Waits for you to insert a disk before beginning to search for source files. .pg |tRestore|t Restores files that were backed up using the backup program. DO NOT USE - BUGGY. |tRmdir|t (rd) Removes a directory from a multilevel directory structure. rmdir [drive:]path rd [drive:]path |tSelect|t Installs MS-DOS on a hard disk or on floppy disks and creates autoexec.bat and config.|nsys|n files containing the desired configuration information. |tSet|t Sets one string of characters in the environment equal to another string for later use in programs. set [string=[string]] .pg |tShare|t Installs file sharing and locking. share [/f:space][/L:locks] /f:space Allocates file space (in bytes) for the area used to record file sharing information. /L:locks Allocates the number of locks you want, default is 20. |tSort|t Reads input, sorts the data, then writes the sorted data [source] || sort [/r][/+n] sort [/r][/+n] < source /r Reverses the |nsort|n; that is, sorts from Z to A, and then from 9 to 0. /+n Sorts the file according to the character in column n |tSubst|t Substitutes a string for a |npath|n. subst [drive: drive:path] subst drive: /d the /d switch deletes a virtual drive. |tSys|t (System) Transfers MS-DOS system files from the disk in the default drive to the disk in the specified drive. sys drive: .pg |tTime|t Allows you to enter or change the |ntime|n known to the system. time [hours:minutes[:seconds [.hundredths]]] |tTree|t Graphically displays the |npath|n (and, optionally, lists the contents) of directory |ntree|n on the given drive. tree [pathname:] [/f] [/a] /f Displays the names of the files in each directory. /a Instructs |ntree|n to use the graphic characters available on all code pages. Allows for faster |nprint|ning. |tType|t Displays the contents of a text file on the screen. type [drive:]filename |tVer|t Prints the MS-DOS version number. |tVerify|t Turns the |nverify|n switch on or off when writing to a disk. verify [on] verify [off] .pg |tVolume|t Displays the disk |nvolume|n |nlabel|n and serial number, if they exist. vol[drive:] |tXcopy|t Copies files and directories, including lower level directories, if they exist. xcopy [drive:]sourcePathName [drive:][destPathName] [/a][/d:date] [/e][/m][/p][/s][/v][/w] xcopy drive:[sourcePathName] [drive:][destPathName] [/a][/d:date] [/e][/m][/p][/s][/v][/w] /a Copies source files that have their archive bit set. /d:|ndate|n Copies source files modified on or after the specified |ndate|n. /e Copies any subdirectories. You must use this switch with the /s switch. /m Same as the /a switch, after copying it turns off the archive bit. /p Prompts you with (Y/N?), before creating each target file. /s Copies directories and subdirectories, unless they are empty. /v |nverify|n each file as it is written to the target /w Causes |nxcopy|n to wait before it starts copying files. .pg |t-More-|t |nMore|n data on the subject on the next page.