home *** CD-ROM | disk | FTP | other *** search
-
- CHKFRAG Version 1.3 - March 27, 1990
- Modified by Bruce Bequette for Large Drive support.
- The original CHKFRAG 1.0 appeared in PC Magazine.
- Distributed through San Diego PCBoard (C)
- (619) 584-1715 (data)
-
-
- format CHKFRAG [d:] [/% | /N | /E] [/L] [/10 | /100]
-
- where d: is the drive to check for fragmentation
- /% sets errorlevel as a percentage
- /N sets errorlevel to number of fragmented files (max 254)
- /E sets errorlevel number of extra sections (max 254)
- /L causes fragmented files to be listed
- /10 divide return result by 10
- /100 divides the return result by 100 before
- setting DOS errorlevel. These will allow you to
- exceed the (max 254) limit on the /E and /N options.
- They have no effect on the /% option.
-
- This release merely adds the options /10 and /100 to scale the return
- errorlevel into something manageable by batch files. This is in direct
- response to a request by a sysop.
-
- =========================================================================
-
- CHKFRAG Version 1.2
-
- This was released on December 28, 1989 when it was discovered that I
- had messed up handling of the 12 bit FAT's. It is corrected in this
- version.
-
- ===========================================================================
-
- CHKFRAG Version 1.1 - December 28, 1989
- Modified by Bruce Bequette for Large Drive support.
- The original CHKFRAG 1.0 appeared in PC Magazine.
- Distributed through San Diego PCBoard (C)
- (619) 584-1715 (data)
-
- format CHKFRAG [d:] [/% | /N | /E] [/L]
-
- where d: is the drive to check for fragmentation
- /% sets errorlevel as a percentage
- /N sets errorlevel to number of fragmented files (max 254)
- /E sets errorlevel number of extra sections (max 254)
- /L causes fragmented files to be listed
-
- This version of CHKFRAG has been modified to support large disk
- drive partitions and DOS 4.x structures.
-
- When I originally ran CHKFRAG.EXE 1.0, it gave me an error reading
- the boot record on my disk. It turns out that CHKFRAG 1.0 couldn't
- handle disks with a large partition. So I compiled it to run under
- CodeView and found part of the problem. There were numerous warning
- messages from the compiler, memory addressing problems, and in MicroSoft
- C verison 5.1, it handled structure declarations differently than
- previous version, and returned erroneous results unless you used the
- /Zp switch (support for packed structures).
-
- I cleaned up all of the warning messages, properly declared all functions
- and typecast all variables that needed it. In addition, I added support
- for large disk drives. The code still requires the /Zp compiler switch,
- but that won't concern you because I have decided not to release the
- modified source code.
-
- If you have problems with this program, please send a note to me on
- San Diego PCBoard at (619) 584-1715 (2400b).
-
- ***************************************************************************
- The original documentation follows.
- ***************************************************************************
-
- CHKFRAG
- Command
-
- Bob Flanders and Michael Holmes
- August, 1989 (Utilities)
-
- Purpose: To report, on-screen, the extent of file fragmentation on a hard
- disk, and provide an ERRORLEVEL value usable within a batch file to call a
- defragmenting program.
-
- Format: CHKFRAG [d:] [/% | /N | /E] [/L]
-
- Remarks: Executed without any of its optional parameters, CHKFRAG
- produces a screen report indicating the number of files and directories, how
- many and what percentage of these are fragmented, and how many extra (non-
- contiguously stored) parts of files are contained on the currently-logged drive.
- An ERRORLEVEL code from 0-100, reflecting the percentage of fragmented files,
- (the /% parameter is the default) is also shown.
-
- An alternative drive (d:) to be analyzed may be specified, as may be
- ERRORLEVEL return codes that reflect the actual number of fragmented files (the
- /N parameter) or of extra sections (the /E parameter). The ERRORLEVEL return
- codes are not intended for strict accuracy: if any file is fragmented the
- minimum ERRORLEVEL returned by the /% parameter is 1%, and 254 is the maximum
- ERRORLEVEL returned by the /N and /E switch options. These return codes are
- intended to be used to trigger automatic loading and execution of the user's
- defragmenting utility from within a batch file. An ERRORLEVEL return code of
- 255 is used to indicate an error condition, which halts operation.
-
- If desired, a list of the names of fragmented files and directories can
- be produced by specifying the optional /L parameter. The normal screen output
- from CHKFRAG may be redirected to a file or to a printer, for easier analysis.
-
- The DOS CHKDSK command, specified with its /F switch, should be executed
- before running CHKFRAG; lost clusters or cross-linked files are interpreted by
- CHKFRAG as a error condition. Drives created with the DOS ASSIGN or SUBST
- commands, and directories created by JOIN, are not checked by CHKFRAG. While
- analyzing large disks, the utility requires approximately 100KB of available
- RAM. On-screen recommendations are to consider using a defragmenting utility
- when file fragmentation is in the range from 11% to 75%, and definitely to
- defragment disks that show more than 75% fragmentation.
-
- CHKFRAG.EXE was written in the C language and its source code should be
- compiled using the Microsoft C Compiler, Version 5.0 or later.
- «MDNM»
-