home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
magazine
/
pcmagazi
/
1992
/
04
/
showdupe.doc
< prev
next >
Wrap
Text File
|
1992-01-23
|
10KB
|
209 lines
SHOWDUPE.EXE Version 1.0
Richard Hale Shaw February 25, 1992 (Utilities)
SHOWDUPE finds all duplicate files on one or more hard disk drives,
organizes them, displays them in a list box, and lets you interactively
view, compare, select, and delete them.
USING SHOWDUPE:
The syntax for SHOWDUPE is
SHOWDUPE <d:\path> [d:\path]
where d: is the drive and \path is the path to the directory in which
SHOWDUPE should begin to search. SHOWDUPE will recursively search each
directory and all of its subdirectories. If you don't specify at least
a drive on the command line, SHOWDUPE will default to the Search
Directories entry in SHOWDUPE.INI, its configuration file.
As the syntax indicates, you can specify more than one search
drive and path on the command line. For example,
SHOWDUPE c:\ d:\olddos
There's no limit to the number of drives or directories you can specify
on the command line. The total number of files SHOWDUPE can scan is
limited only by the amount of conventional memory you have available;
I've used it to scan over 7,000 files on a 200MB hard drive without
any problems.
Before you run SHOWDUPE, make sure SHOWDUPE.EXE and SHOWDUPE.INI
are both in the current directory, or in a directory that is on your
path. Once you execute the program, SHOWDUPE displays a window that
lists all the files in the designated directories as it scans them.
It then displays a window that lists your duplicate files.
After it has found all the duplicate files, SHOWDUPE builds two
tables, DUPES.IDX and DUPES.DAT, which it puts in the same directory
as SHOWDUPE.EXE and SHOWDUPE.INI. Once it has created these files,
the program won't attempt to create them again unless you delete them.
DUPES.IDX contains a sorted list of the filenames; DUPES.DAT
contains date, time, size, and directory pathname information. All this
information could have been stored in a single file, but then when the
filenames were sorted, SHOWDUPE would have to load all this information
into memory when, in fact, it only needs the filenames.
The menu bar at the bottom of the screen lists the various commands
for operating SHOWDUPE. In addition to using the arrow keys to navigate
the listing of duplicate filenames, you can use Home and End go to the
top and bottom, and PgUp and PgDn to jump through a screenful of
filenames at a time. As you move the highlight bar through the list,
the full path for the highlighted file appears in the Path window near
the top of the screen.
When you are ready to delete a duplicate file, scroll to that
filename and press the Del key. SHOWDUPE will delete the file and gray
its entry in the list box.
You can tag multiple files by moving the highlight bar to each
filename and pressing the Spacebar. SHOWDUPE will change the color of
every entry that is tagged for deletion. If you change your mind and
wish to untag a file, move the highlight bar to that entry and hit
the Spacebar again; it will act as a toggle, and the color of the
entry will return to normal. Once you have tagged all the files you
want to delete, press F7 (Purge) to delete all the tagged files
simultaneously.
You can view a file with a separate file-viewing utility such as
SMOOTH.COM (Michael Mefford's file viewer, which appeared in the
Utilities column, February 14, 1989). SMOOTH scrolls a file on-screen.
If you have a copy in a directory on your path, before deleting a file,
highlight the filename and press Enter: SHOWDUPE will invoke SMOOTH and
let you view the file. If you don't have SMOOTH.COM, you can download
it from SOFTLIB, or Library 2 of the UtilForum on PC MagNet.
While SHOWDUPE uses SMOOTH as its default file viewer, you can
use an alternate file viewer if you prefer, such as Vern Buerg's LIST.
Just modify the Viewer= entry in SHOWDUPE.INI. This initialization
file lets you customize a number of SHOWDUPE's settings.
While SHOWDUPE's list box may indicate that two files have the
same name, date, time and size, they still might not be identical.
How can you be sure they're really different? SHOWDUPE lets you
perform a simple byte-by-byte comparison. Highlight the first filename,
press F10, highlight the second filename, and press F10 again. SHOWDUPE
will compare the contents of the two files and display a message telling
you whether they are identical or not.
When you delete a file with SHOWDUPE, it does not disappear from
the list box but simply appears grayed out. Therefore, after you've
deleted a large number of duplicate files, you may wish to rebuild the
.IDX and .DAT tables. Searching through a long list of files that have
already been deleted isn't efficient. Select F9 (Build) and SHOWDUPE
will rebuild the tables and update the list box.
The Build command can also come in handy if you started deleting
files with SHOWDUPE but didn't finish the task. When you run SHOWDUPE
at a later date, it will redisplay the listing of duplicates exactly
as you left it. However, it will not account for any new files you've
created, new program files you may have loaded that may have created
duplicates, or files you've deleted since the last time you ran
SHOWDUPE. Hit F9 and SHOWDUPE will rebuild the tables, finding any new
duplicates. To abort the table-building process, press any key.
At any time, you can press Ctrl-Enter to shell out to DOS from
SHOWDUPE. Simply type Exit to return.
CONFIGURING SHOWDUPE:
With the increasing popularity of Microsoft Windows, it seems like
almost every tips column in every magazine describes changes you can
make to WIN.INI file. Initialization files are useful to DOS programs,
too: You might have noticed that a number of applications, including
the Norton products, use .INI files to store program settings.
Initialization files are incredibly convenient, because you don't
have to patch the program or own the source code to change the
application. But they can be difficult to use. Some .INI files, like
that of The Norton Commander, are largely binary; others, like Windows'
WIN.INI, are not much more comprehensible. After all, who can remember
what color setting 113 represents?
I wanted to ensure that SHOWDUPE's initialization file, SHOWDUPE.INI
would be easy to configure and understand. You can edit SHOWDUPE.INI
with a simple text editor; you can use plain English words to indicate
settings (for example, the word BLUE designates that color). SHOWDUPE.INI
can contain settings and values in upper- or lower-case letters, or both.
As with most .INI files, you can comment out a line by placing a
semicolon (;) in front of it and add comments to a line by prefacing
the comment with a semicolon. Whenever the program encounters a
semicolon, it ignores that character and the rest of the line. Note
that if a line is repeated, the second occurrence will take effect.
For example if you have ScreenBackGround=BLUE and then
ScreenBackGround=RED, the background will be red.
SHOWDUPE.INI lets you configure SHOWDUPE's screen colors, desktop
colors, and window colors. You can also specify whether the program runs
in 43- or 50-line mode on an EGA or VGA system, or uses the default
screen mode. You can specify an alternate file viewer as well as name
default search directories.
THE COLOR SETTINGS
SHOWDUPE.INI's settings have the form name=value, where name designates
the name of a setting and value is the value of that setting. Thus
DeskTopBackGround=LIGHTGRAY
specifies the LIGHTGRAY color for the DeskTopBackGround setting. This
is true for all settings in SHOWDUPE.INI.
You can specify BLACK, BLUE, GREEN, CYAN, RED, MAGENTA, BROWN, or
LIGHTGRAY for foreground and background color settings. You can also
use DARKGRAY, LIGHTBLUE, LIGHTGREEN, LIGHTCYAN, LIGHTRED, LIGHTMAGENTA,
LIGHTYELLOW, and WHITE for any foreground setting. (Theoretically, you
can also use these colors for background settings, but they cause the
background to blink.)
The six color settings are: ScreenBackGround, ScreenForeGround,
DeskTopBackGround, DeskTopForeGround, WindowBackGround and
WindowForeGround. ScreenBackGround and ScreenForeGround control the
color of the title bar and status lines at the top and bottom of the
screen. The DeskTop settings control the colors of the desktop that
appears under the windows, and the Window settings control the window
colors.
OTHER SETTINGS
The ScreenMode setting specifies whether the program runs in 43- or
50-line mode on an EGA or VGA system. If you don't have such a system,
or just want SHOWDUPE to use the default video mode, set ScreenMode to
DEFAULT:
ScreenMode=DEFAULT
To force SHOWDUPE into EGA or VGA mode on such a system, set ScreenMode
to EGAVGA as follows (the setting is ignored on other systems):
ScreenMode=EGAVGA
Another setting, Viewer=, lets you override the default file viewer,
SMOOTH.COM, if you don't have SMOOTH.COM or prefer another file viewer.
I've used this setting to load an editor like BRIEF or PC Magazine's
TED.COM. Just specify the name of the program:
Viewer=TED.COM
You don't need to specify the directory that the program resides in, as
long as the program is in a directory in your PATH.
Finally, the SearchDirectories setting lets you specify the
default search directories for building duplicate file tables.
Internally, SHOWDUPE defines this setting as NULL. You can override
it by specifying one or more search directories. For example
SearchDirectories=c:\bin d:\bin
If you specify search directories on the command line, they will
override the settings found in SHOWDUPE.INI. This lets you maintain a
set of default search directories in SHOWDUPE.INI, but you can change
them at any time via command line arguments.
In short, SHOWDUPE.INI makes SHOWDUPE far more flexible and fun
to use.
Richard Hale Shaw is a contributing editor of PC Magazine.