Diskcomp command in Windows

The diskcomp command compares the content of two floppy disks. If used without parameters, the diskcomp command will use the current drive to compare both disks.

The diskcomp command compares the content of two floppy disks. If used without parameters, the diskcomp command will use the current drive to compare both disks. To learn how to use this command, please see the Example below.

Diskcomp command in Windows

  1. The syntax of the commandcomp command
  2. Parameters
  3. Note
  4. For example

The syntax of the commandcomp command

 diskcomp [: [:]] 

Parameters

ParameterDescription Specifies the drive that contains one of the floppy disks. Specify a drive that contains another floppy disk. /? Show help at the command prompt.

Note

  1. Use the disk

The diskcomp command only works with floppy disks. You cannot use the diskcomp command with a hard disk. If you specify the hard drive for Drive1 or Drive2, the diskcomp command will display the following error message:

 Invalid drive specification Specified drive does not exist or is nonremovable 
  1. Compare the discs

If all content on the two disks compared is the same, the diskcomp command will display the following message:

 Compare OK 

If the contents are not the same, the diskcomp command will display a message similar to the following:

 Compare error on side 1, track 2 

When the diskcomp command completes the comparison, it displays the following message:

 Compare another diskette (Y/N)? 

If you click Y , the diskcomp command prompts you to insert a disk for the next comparison. If you press N , the diskcomp command will stop comparing.

When diskcomp performs a comparison, it ignores the partition number of the drive.

  1. Ignore the drive parameters

If you omit the Drive2 parameter , the diskcomp command will use the current drive for Drive2. If you omit both drive parameters, the diskcomp command will use the current drive for both. If the current drive is the same as Drive1, the diskcomp command will prompt you to change the location of the disks as needed.

  1. Use a drive

If you specify the same floppy drive for Drive1 and Drive2, the diskcomp command compares them using a drive and prompts you to insert the disk if needed. You may have to change the disks multiple times, depending on the capacity of the disk and the amount of available memory.

  1. Compare different disc types

Diskcomp cannot compare single-sided singles with double-sided discs, as well as high-density (high-density) discs with double-density disks. If the disk in Drive1 is not the same type as the disk in Drive2, the diskcomp command will display the following message:

 Drive types or diskette types not compatible 
  1. Use diskcomp commands with network and redirection drives

Diskcomp does not work on a network drive or on a drive created by the subst command . If you try to use the diskcomp command with a drive of any of these types, the diskcomp command will display the following error message:

 Invalid drive specification 
  1. Compare the original disc with the copy

When you use the diskcomp command with a disk you have made using the copy command , the diskcomp command may display a message similar to the following:

 Compare error on side 0, track 0 

This type of error can occur even if the files on the disk are identical. Although the copy command copies information, it doesn't necessarily have to put that information in the same location on the target disk.

  1. Understand the exit code of the diskcomp command

The following table explains each exit code.

Exit code Description0 The disks are the same. 1 There is a difference. 3 A fatal error has occurred. 4 An initial error has occurred.

To process exit codes returned by the diskcomp command , you can use the environment variable ERRORLEVEL on the if statement in a batch program.

For example

If your computer has only one floppy drive (for example, drive A) and you want to compare two disks, enter:

 diskcomp a: a: 

Diskcomp prompts you to insert each disk, if necessary.

The following example illustrates how to handle the exit code of the diskcomp command in a batch program using the ERRORLEVEL environment variable on the if statement:

 rem Checkout.bat compares the disks in drive A and B echo off diskcomp a: b: if errorlevel 4 goto ini_error if errorlevel 3 goto hard_error if errorlevel 1 goto no_compare if errorlevel 0 goto compare_ok :ini_error echo ERROR: Insufficient memory or command invalid goto exit :hard_error echo ERROR: An irrecoverable error occurred goto exit :break echo "You just pressed CTRL+C" to stop the comparison goto exit :no_compare echo Disks are not the same goto exit :compare_ok echo The comparison was successful; the disks are the same goto exit :exit 

See more:

  1. Dcgpofix command in Windows
  2. Defrag command in Windows
  3. Del command in Windows
4 ★ | 4 Vote