Win2K "secret weapon" file comparison tool (1)

  

First, although it is first sight, it seems to have known each other

WinDiff is a tool for comparing files in windows2000 support tools. Mainly used to compare ASCII files, the most significant use is to compare the source code of the program files. Suppose, if you have a file on your A: disk, it was originally copied from the C: drive. For some reason, you suspect that A: there may be a problem with the files on the disk. If you ensure that the files on the C: disk are no problem at this time, you can use WinDiff for the files on the A: and the files on the C: disk. Compare. If you are familiar with the dos command, you must know the Comp command or the FC command. In fact, WinDiff is equivalent to the above dos command, but this is the Windows version and the function is stronger. Therefore, from a functional point of view: Although the tool is first sighted, it seems to have met.

Also like some programs in the support tool, WinDiff works with both interfaces: the command line interface and the graphical interface. But there are also differences from the tools available in both versions: the graphical interface will appear after WinDiff is launched from the command line. I actually verified it, and the output is consistent with the Windows working interface.

The command line can be used in the command console--CMD window. It works under CMD. The main advantage is that it occupies very little system resources and can be adapted to environments with strict resource constraints. Programs for graphical interfaces Can be used directly in windows2000, the two are actually the same. Another problem is getting online help, we are used to "command/? "The way, with this particularity, in the CMD window, you use /? to get help like the previous command-line program, the result is not a character interface.

But as above Screenshot. Although it is a graphic, it also plays the role of online help.

Second, introduce the command line

The detailed syntax of WinDiff using the command line is as follows:

windiff path1 [path2] [-D] [-O] [-N name] [-S [options] savefile] [-F [options] comp_savefile]

Parameters and Description:

path1 path2

File path for comparison.

-D

Compare only in one directory.

-O

Summary display Compare results.

-N name

This parameter is used to issue a notification (comparison result) after the file comparison is finished. name is the name of the file when the notification is sent over the network.

-S options

Save all file list options. The specific option switches can refer to the following characters:

-s: Compare in the same path Two files.

-l: Compare only the files in the first path (the one on the far left).

-r: Compare only the files in the second path ( The one on the far right.

-d: Compare two files located in different paths.

savefile

is used to specify the name of the file to which the comparison result is written < Br>

-F options

The available options for saving (result) files are as follows:

-i: Save the same file in both paths.

-l: Save the file only in the path where the first file is located.

-r: Save the file only in the path where the second file is located.

-f: Save only the left shift File.

-g: Save only the right shift file.

-s: Save only files similar to the left.

-a: Save only similar and right

The left and right sides here refer to the two files compared. For example, the two files being compared are: filename1 filename2, then filename1 is the left and filename2 is the right.

comp_savefile

The resulting comparison needs to be saved in a file, and the savefile is the name of the file.

To compare the different items in the results, the available background colors are as follows: the left side of the equal sign is the color, and the right side is the item corresponding to the color.

red background = left file

yellow background = right file

blue text = moved line

black text = everything else

Since WinDiff is started in the CMD command console or directly in Windows 2000, the graphical interface appears. Therefore, the following is a normal introduction to the menu and other terms such as menus. For the file comparison using WinDiff command line, the main principle is:

1. Call WinDiff, but do not specify the path of the file to be compared path1 path2, you can click the Compare Files from the File menu with the mouse. Or Compare Directories to specify the files or directories to be compared.

2. Call WinDiff to explicitly point out the file located in path path1. If the file name of path2 is not specified, WinDiff will compare the files in the current directory with the same name as the file already specified.

3. In the same way as above, call WinDiff, only the directory path of path1 is explicitly pointed out. If the directory of path2 is not specified, WinDiff will compare the files in the current directory with the directory files already specified.

4. Call WinDiff, clearly indicating the file name and path in the path path1 and path2, WinDiff will compare the two files.

Following the above step, WinDiff is called, clearly indicating that the path is in the path1 and path2 directories, and WinDiff will compare the files in the two directories.

Since the graphical interface is still displayed after the command line is started, the actual use of these parameters is not very large. To balance the operation of WinDiff from the practicality and convenience, you should learn to master the file comparison operation under the graphical interface. These, we will stay in the next introduction.

Copyright © Windows knowledge All Rights Reserved