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. To learn how to use this command, please see the Example below.
Diskcomp command in Windows
- The syntax of the commandcomp command
- Parameters
- Note
- 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
- 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
- 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.
- 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.
- 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.
- 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
- 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
- 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.
- 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:
- Dcgpofix command in Windows
- Defrag command in Windows
- Del command in Windows
You should read it
May be interested
- Instructions for using Command Promptdeep in windows is a command-line world that is obscure. in this article, we will show you how to solve errors and make your computer more secure.
- Rd command in Windowsthe rd command helps delete a directory
- Cmd command in Windowsthe cmd command starts a new version of the command interpreter, cmd.exe. if used without parameters, cmd will display copyright information and the version of the operating system.
- How to use the command history function in Command Promptcommand prompt is an extremely familiar command for anyone using windows operating system. besides, a lot of current software also supports the command line to perform actions on the command prompt window, instead of on the screen.
- The sfc command in Windows(applies to windows server (semi-annual channel), windows server 2016, windows server 2012 r2, windows server 2012)
- Reg command copy in Windowsto copy an entry to the location specified on the local pc or the remote computer we will use the reg copy command. to learn more about how to use the reg copy command, you can track the syntax, explain the command parameters and the example tipsmake.com has compiled below.
- Fc command in Windowsthe fc command compares two files or a collection of files and displays the differences between them.
- The echo command in Windowsthe echo command displays the message or turns on / off the command repeat feature. if used without parameters, the echo command will display the current echo setting.
- Xcopy command in Windowsthe xcopy command is a command prompt command used to copy one or more files or folders from one location to another. with many options and the ability to copy entire directories, the xcopy command is similar to, but much more powerful, than the copy command.
- The cacls command in Windowsthe cacls command displays or modifies an arbitrary access control list (dacl) on the specified file. the command applies to windows server (semi-annual channel), windows server 2016, windows server 2012 r2, windows server 2012.