The command line utility FC.EXE compares two files. If they are identical, it reports
No differences encountered. If they are different it displays a list of the differences. The programs described below run FC.EXE so the tedious and error prone task of typing the command line is eliminated. A few mouse clicks in Windows Explorer compare the two files.
Make The Batch Program MATCH.BAT Using a text editor such as Notepad, type in the batch code and Save As MATCH.BAT in the C:\CLU directory. When MATCH.BAT is executed the %1 parameter is replaced by the file name sent from Windows Explorer. MATCH.BAT makes the file's directory listing in the C:\CLU\DIR-LIST file. (Note: The program listing is shown below, or may be downloaded from MATCH.BAT) Make The Shortcut Match Two Files In Windows Explorer, open the C:\CLU directory. If the C:\Windows\SendTo directory is not visible in the left pane of Explorer, use the vertical scroll bar to move it into view. Right drag the MATCH.BAT icon and drop it on the SendTo icon. In the pop-up menu click Create Shortcut(s) Here. In Windows Explorer, open the SendTo directory, right click the Shortcut to Match.bat and rename it Match Two Files. Right click the shortcut again and select properties. Edit the Program tab (Figure 1) and the Screen tab (Figure 2). Click Apply and OK. Make A Shortcut To Run QBASIC.EXE In Windows Explorer open the C:\QB directory. Right click the QBASIC.EXE icon, and in the pop-up menu click Create Shortcut. Right click the shortcut and rename it RUN Qbasic. Right click the shortcut again and select properties. Edit the Program tab (Figure 3) and the Screen tab (Figure 2). Click Apply and OK. NOTE that the Working text field in the RUN Qbasic shortcut is blank. RUN Qbasic doesn't set the working directory so the shortcut can be used to make Qbasic programs in any directory. The directory that is open in Windows Explorer is the working directory. Use RUN Qbasic To Make MATCH.BAS Copy the RUN Qbasic shortcut from C:\QB into C:\CLU. In the open C:\CLU directory in Windows Explorer, double click the shortcut. Type in the Qbasic code, Save As MATCH.BAS and close Qbasic.exe. MATCH.BAS is saved in C:\CLU because it is the working directory. In the MATCH.BAS program, the command line to run FC.EXE is executed in a temporary batch program because the SHELL statement in Qbasic can't execute very long command lines. Select Files To Be Matched There are two ways to open the SendTo menu in Windows Explorer. Left click a file icon and in the main menu pull-down the File menu, OR, right click any icon to pop-up its context menu. In either menu, point the mouse cursor to SendTo to display the SendTo menu. The first method works only with files, the second method works with directories and files. How To Match Two Files In Windows Explorer open the directory that contains the first file. Open the SendTo menu and click the Match Two Files shortcut. A short beep signals that the first file has been selected and a message screen displays briefly and then closes. You can still see which file was selected because its name remains highlighted in Windows Explorer. If the second file is in another directory, open that directory. Select the second file and SendTo the Match Two Files shortcut. Two beeps signal that two files have been selected and a message screen displays briefly. The second file name remains highlighted in Windows Explorer. Then the report from FC.EXE is displayed in Notepad. If you accidentally select the same file twice, an error message appears in Notepad and the selection is cancelled. You can also recover if you accidentally selected a wrong first file. Select it again to cancel the selection.
There Is Another Use For These Programs!
Reprinted from the August 2001 issue of PC Update, the magazine of Melbourne PC User Group, Australia |