This command checks a disk and provides a file and memory status report. The command CHKDSK stands for checks for errors on a disk. It displays error messages (if problems are found) and issues a status report. The syntax of the CHKDSK Command is:

CHKDSK [d:] [path] [filename] [/F] [IV]
If you specify the IF option, the program will correct non-contiguous errors when it finds them. These errors generally creep in due to the fact that DOS does not always store files in one continuous block on the disk. If space is limited on the disk (especially if you have previously erased and replaced files), DOS may store the file in two or more pieces in whatever space is available on the disk. If the links between the clusters (blocks of data) are lost, CHKDSK will discover the error and report it. By using the IF option, you tell CHKDSK to find any of these parts of files or programs that have been separated from the rest of the file, to create a new file for each, and to write the lost segment to these files. These new files will all start with the letters FILE and will end with four numbers (starting with 0000) plus a .CHK extension. The first file created will be labeled FILEOOOO.CHK.

/F - Corrects errors when it finds them. If CHKDSK finds lost clusters (parts of files or programs that have been 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).

/N - 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).CHKDSK will analyze the disk in drive A and report a status message. It will look something like this:

53248 bytes in 2 hidden files

301056 bytes in 8 user files

8192 bytes available on disk

524288 bytes total memory

198976 bytes free

The first four lines of this display refer to the disk you specified: they indicate the total disk space (the storage capacity of the disk), the number of hidden (system) files stored on the disk, the number of user files stored on the disk, and the amount of storage space still left to be used. If you had created directories on the disk, they would be reported in a fifth line. The last two lines do not refer to the disk you specified; they indicate the amount of memory (RAM) in your system and how much of it remains available for use.

Name:  The CHKDSK command.jpg
Views: 259
Size:  37.5 KB

If (for example) three lost clusters are found, the program will display:

3 lost clusters found in 3 chains.
Convert lost chains to files (y/N)?

After, this error message is displayed, you should run CHKDSK again, this time using the IF option. Enter the command as chkdsk as.

If Three new files would be created on the root
directory of the disk with the following filenames:

FILEOOOO.CHK

FILEOOOl.CHK

FILE0002.CHK

Each of these files will contain a lost cluster. You can use your word processor to look at these files to determine which file the lost segment came from. If the lost segment came from a text file you may be able to re-merge it with the main file. However, upon inspection, you may find that the original text file is intact. This may indicate that the lost segment resulted from file management tasks carried out by your word processor (or other type of program). In this case, you can simply delete the newly created segment file.

If the lost segment came from a program file, you probably will not be able to re-merge it. If possible, replace the file by re-copying from the original source. If you cannot replace the file, carefully check the program file that is stored on disk by running all of its features. It may still be operational.