Ref: 16530026
Title: How to Run the COMPACT Utility on 3Servers
Date: 11/29/90

Copyright 3Com Corporation, 1991.  All rights reserved.

Following is a step-by-step procedure for running the COMPACT utility
on a 3Server.

(It is not possible to run this utility on the C: partition of the server,
but this should not be a problem, because only system software should
reside on C: and the likelihood of file fragmentation is minimal.)


Part 1--Setting Up a Batch File for COMPACT.EXE:

1.  Copy the CHKDSK.EXE program from C:\OS2 to the NETPROG subdirectory on
your server.

2.  Create a file called "Y" that contains a Y and a carriage return, by
typing:

    copy con y
    y <Enter>
    <Ctrl-Z><Enter>

Note:  For <enter>, press the Enter key.  For <ctrl-Z><enter>, hold down the
Ctrl key and press Z, then press Enter.

3.  Put the "Y" file in the NETPROG subdirectory of your server.

4.  Create a file called DEFRAG.CMD, which contains the following commands:

    c:\os2\cache /lazy:*:off
    c:\os2\cache /stop
    compact N: /a < y > compact.out
    c:\os2\cache /lazy:*:on
    c:\os2\cache /start

For N:, put the letter of the drive you want to compact.  Repeat this line
for each disk partition that you want to compact.

Command line switches for COMPACT.EXE:

    /a - alphabetize directory entries
    /e - priority allocate executable files
    /h - move hidden and system files

5.  Put DEFRAG.CMD in the NETPROG subdirectory of the server.


Part 2--Running COMPACT.EXE:

COMPACT.EXE cannot run on the drive from which it is invoked, on a drive
that has files open, or on a redirected drive.  Because there are so many
restrictions as to how COMPACT.EXE may be run, 3Com recommends using the
SHUTDOWN.CMD file (in the Ask3Com forum, Utilities library) in conjunction
with DEFRAG.CMD to insure that there are no open files and that no one is
accessing the server when COMPACT.EXE is run.

For example, you can create a .CMD file called CLEANUP, containing the
following commands:

    call shutdown.cmd
    call defrag.cmd
    net start server /y
    call startme.cmd
    net load srvshare.pro /y
    echo ~     3Com       Lives  > LCD$

STARTME.CMD would contain the commands to restart the server and the value
added services.

You may substitute your own message in the last line of the .CMD file.

Then enter an item in your AT schedule indicating when to run CLEANUP.  The
syntax for this command would be

    net admin \\servername /c at 02:00 cleanup.cmd

