Programming Field

Diskcomp - DOS/Command Prompt Reference

[MS-DOS, and Windows NT series up to Windows 8.1] Compares the contents of the specified floppy disk drives.

Syntax

diskcomp[.com] [<drive-letter1>: [<drive-letter2>:]] [/1] [/8]
<drive-letter1>: Specify the floppy disk drive to be used for comparing floppy disks (drive letter and ‘:’ are required). If omitted, the current drive will be used.
<drive-letter2>: Specify a different drive for comparing floppy disks. If omitted, the current drive will be used. Additionally, if ‘<drive-letter2>:’ (default is the current drive when omitted) is the same drive as ‘<drive-letter1>:’, a prompt requesting disk replacement will be displayed during the process.
/1

[MS-DOS] If both the drive and the disk are double-sided (supporting it), only one side will be compared.

[Windows NT series] This option is not available, and comparison cannot be performed if the disk types are different (one is double-sided, and the other is single-sided, for example).

/8 [MS-DOS] Even if the number of sectors per track is other than 8 (such as 9, 15, or 18), only the first 8 sectors per track will be compared.

Details

Diskcomp compares two floppy disks on a track-by-track basis. You cannot specify a drive other than a floppy disk drive for the drive designation. Since the comparison is done on a track-by-track basis, even if the files inside the disks match, if the positions within the disk where the files exist (such as track or sector) are different, they will be considered as different. However, it does not compare volume serial numbers.

[Windows 10 and later] In Windows 10 and later, Diskcomp program is not available, possibly due to the discontinuation of support for floppy disks.

If you want to compare individual files (or multiple files together), you can use Fc or Comp.

Diskcomp returns an exit code, allowing for conditional checks in batch files using If Errorlevel. The exit codes are as follows:

CodeMeaning
0The comparison result indicates that the disks are identical.
1The comparison result indicates that there are differences in the disks.
2The comparison process was interrupted by the input of Ctrl+C, and the operation has been aborted.
3An unrecoverable error (such as a hardware-related error) has occurred.
4An error occurred during the initialization process.

Samples

diskcomp A: A:

Compares floppy disks using only the A drive. Disk replacement will be necessary at some point during the process.