If you omit the necessary components of Data1 or Data2 or if you omit Data2, the comp command will prompt you for the missing information.
If Data1 contains only the drive letter or directory name, without the file name, the comp command compares all the files in the specified directory with the file specified in Data1.
If Data2 contains only one drive letter or directory name, the default file name for Data2 is the same as in Data1.
If the comp command cannot find the file (s) you specify, it will prompt you with a message to determine if you want to compare other files.
Compare files in different locations
The comp command can compare files on the same drive or on different drives, and in the same folder or in different folders. When comparing files, it displays their location and file name.
Compare files with the same name
The files you compare may have the same file name, as long as they are in different folders or on different drives. If you do not specify the file name for Data2, the default file name for Data2 is the same as the file name in Data1. You can use wildcards ( * and ? ) To specify the file name.
Compare files of different sizes
You must specify the / n parameter to compare files of different sizes. If the file size is different and the / n parameter is not specified, the comp command will display the following message:
Files are different sizes
Compare more files (Y/N)?
To compare these files, press N to stop the comp command. Then, run the comp command with the / n option to compare only the beginning of each file.
Compare sequential files
If you use wildcards ( * and ? ) To specify multiple files, the comp command will find the first file that matches Data1 and compare the file with the corresponding file in Data2, if it exists. The comp command reports the comparison results for each file that matches Data1. When completed, the comp command displays the following message:
Compare more files (Y/N)?
To compare other files, press Y. The comp command will prompt you for the location and name of the new file. To stop comparing, press N. When you press Y , the comp command will prompt you for command line options to use. If you do not specify any command line options, the comp command will use the options you specified earlier.
For example
To compare the contents of the C: Reports folder with the SalesBackupApril backup folder, enter:
comp c:reports salesbackupapril
To compare the first 10 lines of text files in the Invoice folder and display the results in decimal format, enter:
the 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.
command 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.
to 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.
the 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.
the 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 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.