Diskcomp


Applies To: Windows Server 2008,Windows Vista

Compares the contents of two floppy disks. If used without parameters, diskcomp uses the current drive to compare both disks.

For examples of how to use this command, see Examples.

Syntax


Copy Code

diskcomp [<Drive1>: [<Drive2>:]]

Parameters

Parameter

Description

<Drive1>

Specifies the drive containing one of the floppy disks.

<Drive2>

Specifies the drive containing the other floppy disk.

/?

Displays help at the command prompt.

Remarks


Copy Code

Invalid drive specification
Specified drive does not exist
or is nonremovable


Copy Code

Compare OK

If the tracks are not the same, diskcomp displays a message similar to the following:


Copy Code

Compare error on
side 1, track 2

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


Copy Code

Compare another diskette (Y/N)?

If you press Y, diskcomp prompts you to insert the disk for the next comparison. If you press N, diskcomp stops the comparison.

When diskcomp makes the comparison, it ignores a disk's volume number.


Copy Code

Drive types or diskette types not compatible


Copy Code

Invalid drive specification


Copy Code

Compare error on
side 0, track 0

This type of error can occur even if the files on the disks are identical. Although copy duplicates information, it does not necessarily place it in the same location on the destination disk.

Exit code

Description

0

Disks are the same

1

Differences were found

3

Hard error occurred

4

Initialization error occurred

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

Examples

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


Copy Code

diskcomp a: a:

Diskcomp prompts you to insert each disk, as needed.

The following example illustrates how to process a diskcomp exit code in a batch program that uses the ERRORLEVEL environment variable on the if command line:


Copy Code

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

Additional references

Command-Line Syntax Key