           WinTidy - Identify and Remove Unwanted Files

WinTidy helps you control disk space usage.  There are many programs that 
generate backup files that can be safely deleted once a project has been 
completed, and program developers may wish to delete those "intermediate" files 
and pre-compiled headers that typically clutter up C++ or Delphi projects.  
WinTidy identifies these files, and will allow you to try and delete them.  It 
does *not* delete the files automatically, unless a special command-line option 
is explicitly set.

     ========================== WARNING ==============================
      You accept any resonsibility for deleting files on your system.
       Take a backup if you are at all uncertain what you are doing!
     ========================== WARNING ==============================


Usage:

Extract WinTidy.exe from the zip file to a convenient location, and run it!
You need no other files from the .ZIP, they are provided for your interest.

If you don't already have Borland's run-time library, you will also need to 
download the file VCL30.zip from any site offering it.  For example:
  http://www.user.globalnet.co.uk/~hermes02/Freeware/VCL30.zip
Extract the file VCL30.DPL from this archive and copy to your Windows System
folder (e.g. \Windows\System or \WinNT\System32).  

Press the Find button to search for unwanted files.  WinTidy normally scans all 
locally-connected hard disks.  You can select or unselect individual drives in 
the Select Drives list box.  You can also choose a common sub-folder tree to scan 
across all selected hard disks by entering a folder specification in the Folder 
Mask.  In this way you can scan, say, all the folders called \TEMP on every 
drive.  Leaving the mask as its default "\" scans the entire drive.

Optionally, if you make an icon or shortcut for WinTidy, you can have one 
parameter which causes the folder mask to be preset to that parameter.  The files 
are presented in a list box in size order, so you can concentrate on removing the 
largest files first.  Maximum results for minimum effort!  Select the files you 
want to delete in the list box, and then press the Delete button.

Normally, for safety, WinTidy will not actually delete files, but instead will 
move them to the Recycle Bin.  This means that the disk space will not actually 
be returned until the Recycle Bin is emptied.  In the options dialog, the pre-
version 2.1 behaviour (to use Borland's Erase function) can be restored.

If you become completely happy with the operation of WinTidy and wish to 
completely automate folder searching and file deletion, it is possible to use a 
second command-line parameter which must be exactly "-auto_delete".

There are two further command-line parameters which allow you to specify a 
command separated list of files either to be kept, or to be deleted, for example:

  -keep=C:\cache\*.htm,"D:\safe files\*.*"
  -delete=E:\temp\*.gif,"C:\unsafe files\*.*"

Note that file specifications with embedded spaces must be in double quotes.


Command Line Parameters for WinTidy:

 WinTidy  <path>  [-auto_delete]  [-keep=<wildcards>]  [-delete=<wildcards>]

where

 <path>       is a folder specification without a disk drive
              e.g.  \Windows\Temp
              must be the first parameter

 [-auto_delete]  must be the second parameter

 <wildcards>  are one or more comma separated wildcard file specifications
              e.g.  C:\cache\*.htm,"D:\safe files\*.*"
              Note that the disk specification IS required.

 multiple "-keep=" and "-delete=" parameters are allowed.  

I don't know what  the maximum length of a command line under Windows 95 and 
Windows NT 4 actually is!


What files are "unwanted"?

As supplied, the program regards the following files as unwanted.  To change this 
requires editing the registry entries:

  HKEY_CURRENT_USER\Software\David J Taylor\Windows Tidy\FilesToFind
  HKEY_CURRENT_USER\Software\David J Taylor\Windows Tidy\ExtraFilesToFind

   *.tmp    ~*.*     *.~*     *.?~?    
   *.aps    *.bak    *.bk?    *.bsc
   *.dmp    *.dsm    *.ilk    *.pch    
   *.rws    *.sbr    *.$$$    backup*.wbk

There is also an option to be rather more agressive in selecting files, when you 
are getting really desparate for space.  This seeks out Windows 95 and NT help 
file searching add-ons, the .FTS and .GID files.  These can be recreated by 
Windows when required.  See the Options, What-to-find menu to change this choice.

By default, WinTidy ignores files that have the hidden, read-only or system
attributes set, or have zero size.  This is primarily a safety measure since such 
files are often required by Windows.  Use the Options, Ignore menu to alter this 
behaviour.

To recover even more disk space, you may also want to empty the cache of any Web 
browsers you have, particularly if you have one installed which is no longer in 
use.  If you run a multi-user system, like Windows NT, or you user a number of 
user profiles in Windows 95, removing unused profiles can recover 2MB or more 
for each profile deleted.  Be sure to extract any personal data first!  If you 
run both Windows 95 and NT, you might want to delete NT's PAGEFILE.SYS in 95's 
autoexec.bat, and 95's WIN386.SWP in NT's autoexec.nt.


Why can't I delete "\Windows\Temporary Internet Files"?

You might be tempted to clean out the cache of your browser with a command
parameter like:

  -delete="C:\Windows\Temporary Internet Files\*.*"

and wonder why the files aren't deleted.  This is because the files are actually 
stored in four sub-folders named Cache1..Cache4 which the Explorer shell hides 
from you.  Run WinFile.exe to see the truth!  Rather than build up an overly 
complex command line, I'd suggest using the Internet Explorer View, Options menu, 
Advanced tab, to alter the disk space settings or clear the cache as required.


Notes:

The program is written with Borland's Delphi 3.02, and most source is included.  
You do not need access to Delphi 3.02 to run WinTidy, which runs on Windows 95 
and Windows NT 4.0.


Release information:

V2.0.2  1996 Apr 16  Add severity button, find .FTS, .GID
                     Add .DMP files to normal list
                     Add status bar
V2.0.4  1996 Sep 19  Update btnSelectAllClick to use more efficient method
V2.1.0  1997 Mar 16  Suggestions from John Weersing (temlib@iinet.com)
                     Option to ignore zero-length, ReadOnly, Hidden & System files
                     Multiple drive search capability,
                     still uses directory to filter on each individual drive
                     Add -auto_delete command-line option - exact case required
                     Display file attributes
                     Allow for -keep= and -delete= parameters
                     Remove case formatting for file and directory names
                     Store unwanted file name lists in the registry
                     Normally use the Recycle Bin for delete
                     Check for Win95 or NT 4 minimum OS
V2.2.0  1997 May 01  Add .NCB as unwanted file type
                     Use my TDiskListView component
                     Use my TFileListView component
                     Re-organise screen layout
                     Note that file name list to ShellFileOp was single null
                       terminated, might have prevented some deletions?
V2.3.0  1997 May 18  Version for Delphi 3.0
                     Add hint for FileListView giving file name
                     Make start-up time pre-enabled to deliver first message
V2.3.2  1997 Nov 22  Version for Delphi 3.02
                     Don't include .DSM files (Visual Studio Macros)
                     Noted that the location of ABOUT.PAS depends on Delphi
                       install path, means you have to edit the project source
V2.3.4  1998 Mar 20  New version of FileListView
                     Use Brad Stowers' VersionInforesource for the About Box
V2.3.6  1998 Mar 22  Don't enter files that match more than one criterion
                     Catch problem of clicking on ListView with nothing selected


Contacting the author:

This program is Freeware, but remains copyright of David Taylor, Edinburgh, 
1996-1997.  This program is provided "as is", without any support.  Whilst I 
cannot answer queries relating to the use of this program, I'd welcome any 
comments or suggestions for improvements you may have.


david.taylor@gecm.com
1998 March 22
