|Archived content. No warranty is made as to technical accuracy. Content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.|
Displays a list of all MS-DOS 6 commands and gives a brief explanation of each. The information that the fasthelp command displays is similar to, but less detailed than, the information found in MS-DOS Help.
On This Page
Specifies the name of the command about which you want information. If you do not specify a command name, the fasthelp command lists and briefly describes every command provided with MS-DOS 6.
You can use fasthelp to get online Help for a command in two ways. You can specify the name of the command on the fasthelp command line, or you can type the name of the command and the /? switch at the command prompt. For example, you can type either of the following commands to get information about the xcopy command:
fasthelp xcopy xcopy /?
The second command is slightly faster.
For information about MS-DOS Help, see the help command.
Starts the Fastopen program, which improves performance on computers with large directories. Fastopen decreases the amount of time that MS-DOS takes to open frequently used files. Do not use this command when you are running Windows.
Fastopen tracks the location of files on a hard disk and stores the information in memory for fast access.
fastopen drive :[[=]n] [drive:[[n][...]] [/x]
In your CONFIG.SYS file, use the following syntax:
install=[[dos-drive:]dos-path]fastopen.exedrive:[[=]n] [drive:[[=]n][...]] [/x]
Warning: To avoid losing data, do not run a defragmentation program such as Microsoft Defragmenter while FASTOPEN.EXE is loaded.
[ dos-drive :] dos-path
Specifies the location of FASTOPEN.EXE.
Specifies a hard disk drive for which you want Fastopen to track the opening of files.
Specifies the number of files Fastopen can work with at the same time. Valid values for n are in the range 10 through 999. The default value is 48.
Creates the name cache in expanded memory instead of in conventional memory. The name cache is an area of memory in which MS-DOS stores (caches) the locations and names of the files that you open. This cache conforms to version 4.0 of the Lotus/Intel/Microsoft Expanded Memory Specification (LIM EMS).
How Fastopen tracks information
Every time you open a file, Fastopen records its name and location in the name cache. If you later reopen a file recorded by Fastopen, the access time is greatly reduced.
Limits on using Fastopen
Fastopen works only on hard disks and does not work over a network. You can use Fastopen with as many as 24 hard-disk partitions at one time. For each partition, Fastopen can track the number of files specified by the n parameter. The maximum number of files that Fastopen can track on all partitions is 999.
You cannot run more than one copy of Fastopen at the same time. If you want to change the Fastopen settings, you must restart MS-DOS.
You should not use the Fastopen command from MS-DOS Shell, because doing so can lock up your machine.
Memory requirements for Fastopen
Fastopen requires approximately 48 bytes of memory for each file that it tracks.
Adding the fastopen command to your CONFIG.SYS file
You can add a Fastopen command to your CONFIG.SYS file by using the install command. Use this technique when you do not want to start Fastopen from the MS-DOS command line or from your AUTOEXEC.BAT file.
If you want MS-DOS to track the location of as many as 100 files on drive C, add the following line to your CONFIG.SYS file:
Compares two files and displays the differences between them.
To make an ASCII comparison, use the following syntax:
fc [/a] [/c] [/l] [/lbn] [/n] [/t] [/w] [/nnnn][drive1:][path1]filename1 [drive2:][path2]filename2
To make a binary comparison, use the following syntax:
fc /b [drive1:][path1]filename1 [drive2:][path2]filename2
[ drive1 :][ path1 ] filename1
Specifies the location and name of the first file you want to compare.
[ drive2 :][ path2 ] filename2
Specifies the location and name of the second file you want to compare.
Abbreviates the output of an ASCII comparison. Instead of displaying all the lines that are different, fc displays only the first and last line for each set of differences.
Ignores the case of letters.
Compares the files in ASCII mode. Fc compares the two files line by line and attempts to resynchronize the files after finding a mismatch. This is the default mode for comparing files that do not have extensions of .EXE, .COM, .SYS, .OBJ, .LIB, or .BIN.
Sets the number of lines for the internal line buffer. The default length of the line buffer is 100 lines. If the files being compared have more than this number of consecutive differing lines, fc cancels the comparison.
Displays the line numbers during an ASCII comparison.
Does not expand tabs to spaces. The default behavior is to treat tabs as spaces, with stops at each eighth character position.
Compresses white space (tabs and spaces) during the comparison. If a line contains many consecutive spaces or tabs, the /w switch treats these characters as a single space. When used with the /w switch, fc ignores (and does not compare) white space at the beginning and end of a line.
Specifies the number of consecutive lines that must match before fc considers the files to be resynchronized. If the number of matching lines in the files is less than this number, fc displays the matching lines as differences. The default value is 2.
Compares the files in binary mode. Fc compares the two files byte by byte and does not attempt to resynchronize the files after finding a mismatch. This is the default mode for comparing files that have extensions of .EXE, .COM, .SYS, .OBJ, .LIB, or .BIN.
Reporting differences between files for an ASCII comparison
When you use fc for an ASCII comparison, MS-DOS reports differences between two files by displaying the name of the first file, followed by the last line to match in both files, followed by the lines from filename1 that differ between the files, followed by the first line to match in both files. MS-DOS then displays the name of the second file, followed by the last line to match, followed by the lines from filename2 that differ, followed by the next line to match.
Using the /b switch for binary comparisons
MS-DOS uses the following format to report mismatches found during a binary comparison:
xxxxxxxx: yy zz
The value of xxxxxxxx specifies the relative hexadecimal address for the pair of bytes, measured from the beginning of the file. Addresses start at 00000000; the hexadecimal values for yy and zz represent the mismatched bytes from filename1 and filename2, respectively.
You can use wildcards (* and ?) in either of the filenames you specify with the fc command. If you use a wildcard in filename1, fc compares all the specified files to the file specified by filename2. If you use a wildcard in filename2, fc uses the corresponding value from filename1.
How fc uses memory
When comparing ASCII files, fc uses an internal buffer (large enough to hold 100 lines) as storage. If the files are larger than the buffer, fc compares what it can load into the buffer. If fc does not find a match in the loaded portions of the files, it stops and displays the following message:
Resynch failed. Files are too different.
When comparing binary files that are larger than available memory, fc compares both files completely, overlaying the portions in memory with the next portions from the disk. The output is the same as that for files that fit completely in memory.
Suppose you want to make an ASCII comparison of two text files that are named MONTHLY.RPT and SALES.RPT, and you want to display the results in abbreviated format. To make this comparison, type the following command:
fc /a monthly.rpt sales.rpt
To make a binary comparison of two batch files named PROFITS.BAT and EARNINGS.BAT, type the following command:
fc /b profits.bat earnings.bat
The results of this command will be similar to the following:
00000002: 72 43 00000004: 65 3A 0000000E: 56 92 00000012: 6D 5C 00000013: 0D 7C 00000014: 0D 0A 00000015: 0A 0D 0000001E: 43 7A 0000001F: 09 0A 00000022: 72 44 ... ... ... 000005E0: 00 61 000005E1: 00 73 000005E2: 00 73 000005E3: 00 69 000005E4: 00 67 000005E5: 00 6E 000005E6: 00 6D 000005E7: 00 65 000005E8: 00 6E FC: EARNINGS.BAT longer than PROFITS.BAT
If the PROFITS.BAT and EARNINGS.BAT files were identical, fc would display the following message:
FC: no differences encountered
To compare every .BAT file in the current directory with the file NEW.BAT, type the following command:
fc *.bat new.bat
To compare the file NEW.BAT on drive C with the file NEW.BAT on drive D, type the following command.
fc c:new.bat d:*.bat
To compare each batch file in the root directory on drive C to the file with the same name in the root directory on drive D, type the following command:
fc c:\*.bat d:\*.bat
Specifies the number of file control blocks (FCBs) that MS-DOS can have open at the same time. You can use this command only in your CONFIG.SYS file.
A file control block is a data structure that stores information about a file.
Specifies the number of file control blocks that MS-DOS can have open at one time. Valid values for x are in the range 1 through 255. The default value is 4.
Limitation on opening files
If a program tries to open more than x files by using file control blocks, MS-DOS might close the files that were opened earlier.
Recommended use of the fcbs command
You should use the fcbs command only if a program requires you to do so. Most newer programs do not require file control blocks. However, some older programs might require you to use the fcbs command in your CONFIG.SYS file.
Many programs use file handles. You can specify the number of file handles available using the files command.
To specify that MS-DOS can have up to eight file control blocks open at the same time, add the following line to your CONFIG.SYS file:
Starts the Fdisk program, which configures a hard disk for use with MS-DOS.
Fdisk displays a series of menus to help you partition your hard disk(s) for MS-DOS.
To start the Fdisk program, use the following syntax:
To display partition information without starting the Fdisk program, use the following syntax:
Displays an overview of the partition information of your computer's hard disk(s), without starting the Fdisk program.
Using Fdisk to partition a hard disk
You can use Fdisk for the following tasks:
Creating a primary MS-DOS partition
Creating an extended MS-DOS partition
Setting a partition to active
Deleting a partition
Displaying partition data
Selecting the next hard disk for partitioning, if a system has multiple hard disks
Caution: Do not experiment with Fdisk. If you accidently delete a drive or partition, you will lose data from your hard disk.
Viewing partition information quickly and easily
To display an overview of your computer's partition information without having to start the Fdisk program, use the /status switch. If the /status switch doesn't provide enough detail about your hard disk, then start the Fdisk program without the /status switch and choose option 4.
Changing the size of a partition
To change the size of a partition, you must actually delete the partition and create a new one with a different size.
Maximum partition size
The maximum partition size is 2 gigabytes.
Caution: Deleting a partition deletes all the data stored on that partition.
Using Fdisk with subst
Fdisk does not work on a drive formed by using the subst command.
Limits of Fdisk
Fdisk does not work on a network or an Interlnk drive. Fdisk works only on hard disks physically installed on your computer.
Fdisk and compressed drives
If your computer includes compressed drives, Fdisk does not display information about those drives. A compressed disk drive exists on your physical disk as a hidden, read-only system file called a compressed volume file (CVF). DoubleSpace associates the CVF with a drive letter; you can then use the files stored in that CVF. However, to Fdisk, the compressed volume file is not a separate drive; it is a file just like any other file. For more information about compressed drives, see the chapter "Freeing Disk Space" in the MS-DOS 6 User's Guide.
Specifies the number of files that MS-DOS can access at one time. You can use this command only in your CONFIG.SYS file.
Specifies the number of files that MS-DOS can access at one time. Valid values for x are in the range 8 through 255. The default value is 8.
Although the default setting for the x parameter is 8, some programs require a larger value. A typical setting is 30.
The value you set for files may not be the only determining factor in how many files a program can have open at a time. The design of the program may limit how many files it can have open.
To specify that MS-DOS can access up to 20 files at one time, add the following line to your CONFIG.SYS file:
Searches for a specific string of text in a file or files.
After searching the specified files, find displays any lines of text that contain the specified string.
find [/v] [/c] [/n] [/i] "string" [[drive:][path]filename[...]]
" string "
Specifies the group of characters you want to search for. You must enclose the text for string in quotation marks.
[ drive :][ path ] filename
Specifies the location and name of the file in which to search for the specified string.
Displays all lines not containing the specified string.
Displays only a count of the lines that contain the specified string.
Precedes each line with the file's line number.
Specifies that the search is not to be case-sensitive.
Specifying a string
Unless you specify the /i switch, find searches for exactly what you specify for string. For example, to the find command the characters "a" and "A" are different. If you were to use the /i switch, however, find would ignore case and search for "a" and "A" as if they were the same character.
If the string you want to search for contains quotation marks, you must use two quotation marks for each quotation mark contained within the string.
Using find as a filter
If you omit a filename, find acts as a filter, taking input from the MS-DOS standard source (usually the keyboard, a pipe, or a redirected file) and displaying any lines that contain the string.
Using wildcards with find
You cannot use wildcards (* and ?) in filenames or extensions that you specify with the find command. To search for a string in a set of files you specify with wildcards, you can use the find command in a for command.
Using the /v or /n switch with the /c switch
If you specify the /c and /v switches in the same command, find displays a count of the lines that do not contain the specified string. If you specify the /c and /n switches in the same command, find ignores the /n switch.
Using find in files with carriage returns
The find command does not recognize carriage returns. When you use find to search for text in a file that includes carriage returns, you must limit the search string to text that can be found between carriage returns — that is, a string that is not likely to be interrupted by a carriage return. For example, find does not report a match for the string "tax file" wherever a carriage return occurs between the word "tax" and the word "file".
Find exit codes
The following list shows each exit code and a brief description of its meaning:
The search was completed successfully and at least one match was found.
The search was completed successfully, but no matches were found.
The search was not completed successfully. In this case, an error occurred during the search, and find cannot report whether any matches were found.
You can use the errorlevel parameter on the if command line in a batch program to process exit codes returned by find.
To display all lines from the file PENCIL.AD that contain the string "Pencil Sharpener", type the following command:
find "Pencil Sharpener" pencil.ad
To find a string that contains text within quotation marks, you must enclose the entire string in quotation marks and, in addition, use two quotation marks for each quotation mark contained within the string, as shown in the following example:
find "The scientists labeled their paper ""for discussion only."" It is not a final report." report.doc
If you want to search for a set of files, you can use the find command with the for command. The following command uses this method to search the current directory for files that have the extension .BAT; in each file found, the command searches for the string "PROMPT":
for %f in (*.bat) do find "PROMPT" %f
Suppose you want find to search your hard disk to find and display the filenames on drive C that contain the string "CPU". To do this, you can use the pipe (|) to direct the results of a dir command to find, as shown in the following example:
dir c:\ /s /b | find "CPU"
Before using a pipe for redirection, you should set the TEMP environment variable in your AUTOEXEC.BAT file.
Since find searches are case-sensitive and since dir produces uppercase output, you must either type the string "CPU" in uppercase letters or use the /i switch with find.
Runs a specified command for each file in a set of files. You can use this command in batch programs or at the command prompt.
To use for in a batch program, use the following syntax:
for %% variable in (set) docommand [command-parameters]
To use for from the command prompt, use the following syntax:
for %variablein (set) docommand [command-parameters]
%% variable or % variable
Represents a replaceable variable. The for command replaces %%variable (or %variable) with each text string in the specified set until the command (specified in the command parameter) processes all the files. Use %%variable to carry out the for command within a batch program. Use %variable to carry out for from the command prompt.
( set )
Specifies one or more files or text strings that you want to process with the specified command. The parentheses are required.
Specifies the command that you want to carry out on each file included in the specified set.
Specifies any parameters or switches that you want to use with the specified command (if the specified command uses any parameters or switches).
Using the in and do keywords
In and do are not parameters, but they are required in the for command. If you omit either of these keywords, MS-DOS displays an error message.
Using the replaceable variable
To avoid confusion with the batch parameters %0 through %9, you can use any character for variable except the numerals 0 through 9. For simple batch programs, a single character such as %%f may be all that is necessary.
You can use multiple values for variable in complex batch programs to distinguish different replaceable variables. However, you cannot nest (add) multiple for commands on the same command line.
Specifying a group of files
The set parameter can represent a single group of files or several groups of files. You can use wildcards (* and ?) to specify a file set. The following are valid file sets:
(*.doc) (*.doc *.txt *.me) (jan*.doc jan*.rpt feb*.doc feb*.rpt) (ar??1991.* ap??1991.*)
When you use the for command, the first value in set replaces %%variable (or %variable) and MS-DOS carries out the specified command in order to process this value; this continues until MS-DOS has processed all the files (or groups of files) that correspond to the value (or values) in set.
Suppose you want to use the type command to display the contents of all the files in the current directory that have the extension .DOC or .TXT. To do this and to use the replaceable variable %f, type the following command at the command prompt:
for %f in (*.doc *.txt) do type %f
In this example, each file that has the .DOC or .TXT extension in the current directory is substituted for the %f variable until the contents of every file are displayed. To use this command in a batch file, you would replace every occurrence of %f with %%f. Otherwise, MS-DOS ignores the variable and displays an error message.
MS-DOS supports command switches, pipes, and redirection that you may want to use with the specified command. For example, to redirect the output of the previous example to PRN (the default printer port), you would type the following command:
for %f in (*.doc *.txt) do type %f > prn:
Formats a disk for use with MS-DOS.
The format command creates a new root directory and file allocation table for the disk. It can also check for bad areas on the disk, and it can delete all data on the disk. In order for MS-DOS to be able to use a new disk, you must first use this command to format the disk.
format drive : [/v[:label]] [/q] [/u] [/f:size][/b|/s]
format drive : [/v[:label]] [/q] [/u] [/t:tracks/n:sectors] [/b|/s]
format drive : [/v[:label]] [/q] [/u] [/1] [/4] [/b|/s]
format drive : [/q] [/u] [/1] [/4] [/8] [/b|/s]
Warning: Do not format a floppy disk at a size higher than it was designed for. For more information, see Format — Notes.
Specifies the drive containing the disk you want to format. You must specify a drive parameter. If you do not specify any of the following switches, format uses the drive type to determine the default format for the disk.
If the disk was previously formatted and you do not use the /u switch, the old file allocation table and root directory are saved to allow unformatting of the disk if necessary. If you realize that you formatted the wrong disk, use the unformat command as soon as possible.
Specifies the volume label. A volume label identifies the disk and can be a maximum of 11 characters. If you omit the /v switch or use it without specifying a volume label, MS-DOS prompts you for the volume label after the formatting is completed. If you format more than one disk by using one format command, all of the disks will be given the same volume label. The /v switch is not compatible with the /8 switch. For more information about disk volume labels, see the dir, label, and vol commands.
Specifies a quick format of a disk. With this switch, format deletes the file allocation table (FAT) and the root directory of a previously formatted disk, but does not scan the disk for bad areas. Use the /q switch to format only previously formatted disks that you know are in good condition.
Specifies an unconditional format of a disk. Unconditional formatting destroys all existing data on a disk and prevents you from later "unformatting" the disk. You should use /u if you have received read and write errors during use of a disk. For information about unformatting a disk, see the unformat command.
Specifies the size of the floppy disk to format. When possible, use this switch instead of the /t and /n switches. Use one of the following values for size:
160 (or 160K or 160KB)
160K, single-sided, double-density, 5.25-inch disk
180 (or 180K or 180KB)
180K, single-sided, double-density, 5.25-inch disk
320 (or 320K or 320KB)
320K, double-sided, double-density, 5.25-inch disk
360 (or 360K or 360KB)
360K, double-sided, double-density, 5.25-inch disk
720 (or 720K or 720KB)
720K, double-sided, double-density, 3.5-inch disk
1200 (or 1200K or 1200KB or 1.2 or 1.2M or 1.2MB)
1.2-MB, double-sided, quadruple-density, 5.25-inch disk
1440 (or 1440K or 1440KB or 1.44 or 1.44M or 1.44MB)
1.44-MB, double-sided, quadruple-density, 3.5-inch disk
2880 (or 2880K or 2880KB or 2.88 or 2.88M or 2.88MB)
2.88-MB, double-sided, extra-high-density, 3.5-inch disk
Reserves space for the system files IO.SYS and MSDOS.SYS (as hidden files) on a newly formatted disk. In previous versions of MS-DOS, it was necessary to reserve this space before using the sys command to copy the system files to the disk. This switch is maintained in MS-DOS version 6.0 for compatibility reasons only.
Copies the operating system files IO.SYS, MSDOS.SYS, and COMMAND.COM from your system's startup drive to a newly formatted disk that you can use as a system disk. If format cannot find the operating system files, it prompts you to insert a system disk.
Specifies the number of tracks on the disk. When possible, use the /f switch instead of this switch. If you use the /t switch, you must also use the /n switch. These two switches provide an alternative method of specifying the size of the disk being formatted. You cannot use the /f switch with the /t switch.
Specifies the number of sectors per track. When possible, use the /f switch instead of this switch. If you use the /n switch, you must also use the /t switch. These two switches provide an alternative method of specifying the size of the disk being formatted. You cannot use the /f switch with the /n switch.
Formats a single side of a floppy disk.
Formats a 5.25-inch, 360K, double-sided, double-density floppy disk on a 1.2-MB disk drive. Some 360K drives cannot reliably read disks formatted with this switch. When used with the /1 switch, this switch formats a 5.25-inch, 180K, single-sided floppy disk.
Formats a 5.25-inch disk with 8 sectors per track. This switch formats a floppy disk to be compatible with MS-DOS versions earlier than 2.0.
Formatting a floppy disk
Do not format a floppy disk at a size higher than it was designed for. For example, do not format a 360K floppy disk at 1.2MB.
Also, if you use the format command without specifying the size of the floppy disk, MS-DOS will format the floppy disk at the disk capacity of the disk drive. Thus, if you format a floppy disk without specifying the size, be careful not to use a floppy disk smaller than the capacity of the disk drive.
Typing a volume label
After formatting a floppy disk, format displays the following message:
Volume label (11 characters, ENTER for none)?
The volume label can be a maximum of 11 characters (including spaces). If you do not want your disk to have a volume label, press ENTER. For information about volume labels, see the label command.
Formatting a hard disk
When you use the format command to format a hard disk, MS-DOS displays a message similar to the following before attempting to format the hard disk:
WARNING, ALL DATA ON NON-REMOVABLE DISK DRIVE x: WILL BE LOST! Proceed with Format (Y/N)?_
To format the hard disk, press Y; if you do not want to format the disk, press N.
When formatting is complete, MS-DOS displays messages showing the total disk space, any space marked as defective, the total space used by the operating system (if you used the /s or /b switch), and the space available for your files.
If you do not specify the /u switch or a switch that reformats the disk to a different size, format performs a "safe" format. It clears the file allocation table and root directory of the disk but does not delete any data. You can then use the unformat command to recover the disk if you did not intend to format the disk. Format also checks each sector on the disk to ensure that the sector can properly store data. If it locates a sector that cannot store data, format marks that sector to prevent MS-DOS from using it.
If you specify the /u switch or any switch that changes the size of the disk, format performs an unconditional format by deleting all data on the disk.
You can speed up the formatting process by using the /q switch. Use this switch only if you have not received read or write errors on your disk. You can speed up the process even more by using both the /q and /u switches. If you use the /u switch, format does not save the information necessary to later unformat the disk.
Formatting a new disk
When you use format to format a disk that has never been formatted, specify the /u switch to minimize formatting time.
Using format with a subst drive or a network drive
You should not use the format command on a drive prepared by using the subst command. You cannot format disks over a network or an Interlnk drive.
Format exit codes
The following list shows each exit code and a brief description of its meaning:
The format operation was successful.
The user pressed CTRL+C or CTRL+BREAK to stop the process.
A fatal error occurred (any error other than 0, 3, or 5).
The user pressed N in response to the prompt "Proceed with Format (Y/N)?" to stop the process.
You can check these exit codes by using the errorlevel condition with the if batch command. For an example of a batch program that supports errorlevel conditions, see the choice command.
To format a new floppy disk in drive A using the default size, type the following command:
To perform a quick format on a previously formatted disk in drive A, type the following command:
format a: /q
To format a floppy disk in drive A, completely deleting all data on the disk, type the following command:
format a: /u
To format a 360K floppy disk in drive A and copy the operating system files to the disk to make it a system disk, type the following command:
format a: /f:360 /s
To format a floppy disk in drive A and assign to it the volume label "DATA", type the following command:
format a: /v:DATA
For information about restoring disks after using the format command, see the unformat command.