                     Instructions for Using
        the Script processing features of PartitionMagic


     The site license version of PartitionMagic includes the capability of running a script to
make any changes to the partitions on a machine.  The script consists of an ASCII text file with
text statements defining the operations to take place.  The file can be created with any text editor. 
To execute the script, rather than require user input from the keyboard, the user is required to
pass the name of the script file to the program on the command line.
     When executing from a script, if the program encounters an error it will terminate
immediately,  without processing the rest of the script.  The user can determine if an error has
occurred and what error it was by looking at the log file or error file.  These two files are only
created if specified by the user on the command line.
     Each operation in the script executes on the partition that was last specified.  This means
that specifying a partition must be done before any operation. 
     The script text file allows comments in the C++ form (//).  These can be either a full line
or after a valid statement. An example will be shown later in this file.
     To use scripting to configure remote systems it is necessary for the user to be able to do
the following:

     1.  Load PartitionMagic on a remote system
     2.  Launch PartitionMagic on a remote system
     3.  Get feedback as necessary from a logfile on the remote system

     It is the responsibility of the user to set up remote access.  The scripting language is a tool
that can be used by the user to configure remote systems once the user has access to the remote
systems.

Please read the entire file to become familiar with the operation of script files, before continuing.
                       Table of Contents
                                

1. Command Line Options. . . . . . . . . . . . . . . . . . . . .3
2. Script File Statements for PartitionMagic:. . . . . . . . . .5
3. New Script File Statements for PartitionMagic 3.0 . . . . . 11
4. Script Suggestions and Notes: . . . . . . . . . . . . . . . 18
5. Sample Scripts: . . . . . . . . . . . . . . . . . . . . . . 20
     Scenario 1     General Example. . . . . . . . . . . . . . 20
     Scenario 2     General Example. . . . . . . . . . . . . . 21
     Scenario 3     General Example. . . . . . . . . . . . . . 22
     Scenario 4     General Example. . . . . . . . . . . . . . 24
     Scenario 5     Advanced Fat Properties Examples . . . . . 26
     Scenario 6     Boot Manager . . . . . . . . . . . . . . . 27
     Scenario 7     Cluster Analyzer . . . . . . . . . . . . . 29
     Scenario 8     Copy . . . . . . . . . . . . . . . . . . . 30
     Scenario 9     Info . . . . . . . . . . . . . . . . . . . 31
6. Scripting commands added for 2.0. . . . . . . . . . . . . . 32
7. What's new in 3.0 . . . . . . . . . . . . . . . . . . . . . 34







1. Command Line Options

The following command line options are supported by the Enterprise Version of PartitionMagic.
When specifying multiple options, the order is unimportant.

/CMD=     This is the parameter that will be used to pass the name of the script file to the
          program. For example, if the script file were named SCRIPT.TXT, the syntax for
          running the program from the script would be:

     PQMAGICE /CMD=SCRIPT.TXT

/LOG=     Whenever the program is run from a script, it is suggested that a log of all that
          occurred should be kept.  The /LOG parameter is not unique to the site license
          version, but most useful when used in conjunction with the /CMD parameter to
          review exactly what transpired during the script execution.  The /LOG parameter
          will specify the name of a file where all output will be directed.  The output will
          appear as if a user had been executing the program through keyboard input,
          displaying each script command and all that transpired because of that command. 
          To specify a log named RESULTS.FIL (with the above script file), the command
          line would be:

     PQMAGICE /CMD=SCRIPT.TXT /LOG=RESULTS.FIL

          WARNING:  Do not attempt to modify the partition on which the log file is
                    created.  The log file is created on the partition that PQMAGICE is
                    run from.  If you need to modify this partition don't specify the
                    /LOG switch.  If you do, you will damage your partition.

/ERR=     The Error parameter is used to specify a file to be created if the program should
          terminate with an error.  Because many operations will require the machine to be
          rebooted following script execution, it will not always be possible to return the
          error to the process that called the PQMAGICE program.  For this reason, if the
          program should end in an error and the /ERR parameter is specified, the error
          number will be placed in the file designated by /ERR.  If /ERR is specified and
          the program terminates WITHOUT an error, the file specified will be deleted if it
          exists.  Using this parameter, the user can write a program to just check for the
          existence of the error file to determine if the script was run successfully.  Even if
          this parameter is not used, the error number will appear in the log file (if specified
          by /LOG) along with a text description of the error that occurred. To use the error
          parameter with the above parameters, the syntax would be:

     PQMAGICE /CMD=SCRIPT.TXT /LOG=RESULTS.FIL /ERR=ERROR.FIL

/NRF=     The No Run File parameter is used to specify the name of a file, which if it exists,
          will prevent the script from executing.  This parameter is used to keep the
          program from running a second time, if it were placed in a login script or
          autoexec.bat file.  If the user had specified a /LOG file or a /ERR file, the /NRF
          parameter could check for the existence of these files and prevent the program
          from running if either existed.  For example, if a script were run with the
          parameters specified above (in the /ERR option), using the syntax:


          PQMAGICE /CMD=SCRIPT.TXT /LOG=RESULTS.FIL /ERR=ERROR.FIL
               /NRF=RESULTS.FIL

          would prevent the program from running if the RESULT.FIL existed (if the
          program had been run once already).  The /NRF parameter can also be specified
          more than once on the command line, if it makes sense to check for more than one
          file.
       
/SCO      The Syntax Check Only parameter is used to check the syntax of a script.  It will
          make sure that a partition is always selected before an operation is executed and
          check the syntax of all the script commands. It will also check to ensure that any
          volume labels specified in a select partition statement are unique.  It will not
          actually run the script. The syntax check will not detect logical errors such as
          trying to move the partition when there is not space to move. This parameter can
          be used with the /LOG file if desired.  A successful syntax check will show a
          statement saying that it was successful. Usage for the /SCO parameter would be as
          follows:

     PQMAGICE /CMD=SCRIPT.TXT /SCO

2. Script File Statements for PartitionMagic:

Several special characters are used when describing the syntax of script file statements. These are
described below. The case of the statements is ignored. Before performing an operation, you
must first select the drive and partition that you wish to act upon. See "Select Drive" and "Select
Partition."

     {}- Denotes a required parameter
     [] - Denotes an optional parameter
     |   - Denotes a choice among two or more options

Allow Manual Reboot
     Allow the script to run even if it is determined that the program can not reboot the
     machine remotely, after changes are made.  This should be the first statement if used.
     No parameters.

Bad Sector Retest
     Retest the current partition for bad sectors and unmark any bad sectors that have been set
     incorrectly.

Check
     Check the partition for errors.
     No Parameters.

Convert To HPFS
     Convert the partition to HPFS.
     No Parameters.

Create /FS={FAT | HPFS | NTFS | EXTENDED | UNFORMATTED}
     [/Label="NEW LABEL"]
     [/Size=Value] 
     [/Position={BEGINNING | END}]
.
     Create a new partition, and, optionally, format it.
     /FS -     The file system parameter is a required parameter.  It can be any of the
               above specified strings.  There may be cases where creating with a certain
               /FS would fail, for example trying to create an Extended partition when
               one already existed.
     /Label -  The label is an optional parameter. Replace "NEW LABEL" with the
               desired volume label. It must be 11 characters or less in double quotes. 
               The script may fail if invalid characters are entered.
     /Size -   The size is an optional parameter.  It is specified in Megabytes and will
               default to the size of the free space if not specified.
     /Position -    The position is an optional parameter.  It must be followed by either END
                    or BEGINNING to specify where the partition will be created in the free
                    space.
     
 Delete{Volume Name | "NO NAME" | "UNKNOWN" }
     Delete a partition.
     Volume Name -
               The volume name is required to delete a partition UNLESS the partition is
               either an extended partition or an unformatted partition.  This is a check to
               ensure that you are destroying data in the proper partition only.  The value
               entered must always be preceded and followed by double quotes. If the
               partition label is blank and the partition is FAT or HPFS, the label entered
               should be "NO NAME".  If the partition is not FAT or HPFS then
               "UNKNOWN" should be entered.
     
Format {Volume Name | "NO NAME" | "UNKNOWN" }
     /FS={ FAT | HPFS | NTFS }
     [/Label="NEW LABEL"]
.
      Format a partition.
     Volume Name - 
               The volume name is required to format a partition UNLESS the partition
               is either an extended partition or an unformatted partition.  This is a check
               to ensure that you are destroying data in the proper partition only.  The
               value entered must always be preceded and followed by double quotes. If
               the partition label is blank and the partition is FAT or HPFS, the label
               entered should be "NO NAME".  If the partition is not FAT or HPFS then
               "UNKNOWN" should be entered.
     /FS -     The file system parameter is a required parameter.  It can be any of the
               above specified strings.  There may be cases where formatting with a
               certain /FS would fail, for example trying to format a FAT partition past
               1024 cylinders.
     /Label -  The label is an optional parameter. Replace "NEW LABEL" with the
               desired volume label. It must be 11 characters or less in double quotes. 
               The script may fail if invalid characters are entered.

Hide
     Hide the currently selected partition. See also, "Hide."

Move Left {Max | Min | Value }
     Move a partition to the left. If the partition is the extended partition, only the right
     boundary is changed.
     Max -     Move the partition as far to the left as possible.  Flush with the previous
               partition or beginning of the drive.
     Min -     Move the partition to the left, the minimum amount possible (1 Cylinder)
     Value -   Move the partition left by the amount of the value specified (in
               Megabytes)

Move Right {Max | Min | Value }
     Move a partition to the right. If the partition is the extended partition, only the right
     boundary is changed.
     Max -     Move the partition as far to the right as possible.  Flush with the next
               partition or end of the drive.
     Min -     Move the partition to the right, the minimum amount possible (1 Cylinder)
     Value -   Move the partition right by the amount of the value specified (in
               Megabytes)

Move Space Before {Max | Value }
     Same as Move Right.
     Max -     Same as Move Right Max, makes as much space before the partition as
               possible by moving the partition right.
     Value -   Moves the partition right such that the space before is equal to the value
               specified if possible (specified in Megabytes)

Move Space After {Max | Value }
     Same as Move Left.
     Max -     Same as Move Left Max, makes as much space after the partition as
               possible by moving the partition left.
     Value -   Moves the partition left such that the space after is equal to the value
               specified if possible (specified in Megabytes)

Resize {Max | Min | Value } [/Clustersize={512 | 1 | 2 | 4 | 8 | 16 | 32 | 64}]
     Resize a partition.
     Max -     Resizes to the maximum size possible (Right edge will be flush with end
               of drive or next partition if possible)
     Min -     Resizes to the minimum possible (Determined by the size of the data)
     Value -   Resize to value specified (in Megabytes)
     /Clustersize - Will set the cluster size to the size specified during the resize operation. 
                    (The cluster size must be valid for the partition size specified.)

Resize Larger {Max | Min | Value}  [/Clustersize={512 | 1 | 2 | 4 | 8 | 16 | 32 | 64 }]
     Resize a partition larger by specifying the incremental change in size. See also, "Resize."
     Max -     Same as Resize Max, partition as big as possible
     Min -     Grow the size of the partition by the smallest amount possible. (1
               Cylinder)
     Value -   Grow the size of the partition by the size specified (in Megabytes)
     /Clustersize - Will set the cluster size to the size specified during the resize operation.
                    (The cluster size must be valid for the partition size specified.)

Resize Left Boundary {Max | Min | Value }
     Resize the extended partition by moving the left boundary. This operation is for extended
     partitions only. See also, "Resize Space Before."
     Max -     Resizes to the maximum size possible (Left edge will be flush with end of
               drive or previous partition if possible)
     Min -     Resizes to the minimum possible (Determined by the size of the data)
     Value -   Resize to value specified (in Megabytes)

Resize Left Boundary Larger {Max | Min | Value }
     Resize an extended partition larger by specifying the change in position of the left
     boundary. This operation is for extended partitions only. See also, "Resize Left
     Boundary."
     Max -     Same as Resize Left Boundary Max, partition as big as possible
     Min -     Grow the size of the partition by the smallest amount possible. (1
               Cylinder)
     Value -   Grow the size of the partition by the size specified (in Megabytes)

Resize Left Boundary Smaller {Max | Min | Value }
     Resize an extended partition larger by specifying the change in position of the left
     boundary. This operation is for extended partitions only. See also, "Resize Left
     Boundary."
     Max -     Same as Resize Left Boundary Min, partition as small as possible
     Min -     Partition's size will be decreased by the minimum amount possible. (1
               Cylinder)
     Value -   Partition's size will be decrease by the amount specified. (in Megabytes)

Resize Smaller {Max | Min | Value}   [/Clustersize={512 | 1 | 2 | 4 | 8 | 16 | 32 | 64 }]
     Resize a partition smaller by specifying the incremental change in size. See also,
     "Resize."
     Max -     Same as Resize Min, partition as small as possible
     Min -     Partition's size will be decreased by the minimum amount possible. (1
               Cylinder)
     Value -   Partition's size will be decrease by the amount specified. (in Megabytes)
     /Clustersize - Will set the cluster size to the size specified during the resize operation.
                    (The cluster size must be valid for the partition size specified.)

Resize Space After {Max | Min | Value}  [/Clustersize={512 | 1 | 2 | 4 | 8 | 16 | 32 | 64 }]
     Resize a partition by specifying the free space desired after the partition after the resize is
     completed. See also, "Resize."
     Max -     Resizes so that the space after the partition is as large as possible (The
               partition is as small as possible)
     Min -     Resizes so that the space after the partition is as small as possible (The
               partition is as large as possible)
     Value -   Sizes the partition such that the space after is the size of value (in
               Megabytes)
     /Clustersize - Will set the cluster size to the size specified during the resize operation.
                    (The cluster size must be valid for the partition size specified.)

Resize Space Before {Max | Min | Value }
     Resize an extended partition by specifying the free space desired before the partition after
     the resize is completed. This operation is for extended partitions only. See also, "Resize
     Left Boundary."
     Max -     Resizes so that the space before the partition is as large as possible (The
               partition is as small as possible)
     Min -     Resizes so that the space before the partition is as small as possible (The
               partition is as large as possible)
     Value -   Sizes the partition such that the space before is the size of value (in
               Megabytes)

Resize Clusters {Value | Min | Max }      
     Change the cluster size of a FAT partition.
     Value -   Can be either 512,1,2,4,8,16, 32 or 64.  If the cluster size specified
               requires the partition to change size, the Resize Clusters operation will
               resize the partition as well.
     Min -     If specified, Min will change the partition to the minimum partition size
               possible. This may also require the partition size to change.  If needed, the
               partition size will be changed.
     Max -     If specified, the partition will be modified to use the Largest cluster size
               possible.

Resize Root {Value | Min | Max }
     Change the number of entries in the root directory of a FAT partition.
     Value -   Must be a value between 512 - 1024.  This will change the maximum
               number of root entries possible for this partition. The number actually set
               will be the closest number possible to the number specified.
     Min -     Will set the partition to having the smallest possible maximum number of
               root entries.
     Max -     Will set the maximum number of root entries for the partition to the largest
               number possible.
     
Select Drive {Num}
     Select among the physical drives.
     Num - Number of the drive to select starting at 1.
     
Select Partition {PartitionLetter | "Volume Label"| Next | Previous | Num }
     Select the partition or free space
     PartitionLetter -
               The drive letter of the desired partition.
     Volume Label -
               The volume label of the desired partition. It must be in quotes.
     Extended -     This specifies the extended partition of the selected drive. Do not use
                    quotes. You must use a "Select Drive" statement prior to this statement..
     Next -    Must have had a partition selected previously. Do not use quotes.
     Previous -     Must have had a partition selected previously. Do not use quotes.
     Num -     Number of the partition or free block. This statement should always be
               preceded by a Select Drive statement. The first partition or free block on
               each drive is number 1. Partition numbers are displayed for each partition
               or free block if PartitionMagic is run interactively. This is the only way to
               select free space for creating a partition.

               EXTREME CAUTION should be used when selecting a partition by
               partition number as the numbers change as operations are performed. Once
               a partition is selected by number, it remains selected even if an operation
               changes the number of the selected partition.

Set Active
     Mark the selected partition as the active, or bootable, partition.

Set Default Bad Sector Test State { ON | OFF}
     Set the bad sector testing ON or OFF for all partitions on the currently selected drive. The
     "/BadSectorTest" option overrides this setting.

Unhide
     Unhide the currently selected partition. See also, "Unhide."


3. New Script File Statements for PartitionMagic 3.0:

Advanced FAT Properties 

     This operation allows you to change the FAT properties.
     If this operation is used with out any parameters it will output the current FAT properties.

     /FS={ FAT | FAT32 }
     [/Label="NEW LABEL"] 
     [/Size=value ]
     [/ClusterSize={ 512 | 1 | 2 | 4 | 8 | 16 | 32 | 64 } ]
     [/RootEntries=value ]
     [/ShowProps]

     /FS -     The file system parameter is a required parameter.  It can be any of the
               above specified strings.
     /Label -  The label parameter is an optional parameter. Replace "NEW LABEL"
               with the desired volume label. It must be 11 characters or less in double
               quotes.  The script may fail if invalid characters are entered.
     /Size -   The size parameter is an optional parameter.  It is specified in Megabytes
               and will default to the size of the free space if not specified.
     /Clustersize - The clustersize parameter is an optional parameter. It will set the cluster
                    size to the size specified.  The script may fail if the cluster size is not valid
                    for the partition size selected.
     /RootEntries - The rootentries parameter is an optional parameter.  It will set the
                    maximum number of root entries possible on this partition.  It must be a
                    value between 512 and 1024.
     /ShowProps - The showprops  parameter is an optional parameter which is used to
               display the current settings of the Advanced Fat Properties.

Boot Manager 

     [/Install={BEGINNING | END}]
     [/AddToMenu="MenuNameText"]
     [/ChangeName="MenuNameText"] 
     [/SetAsDefault]
     [/RemoveFromMenu]
     [/StartupMenuDelay={INDEFINITE | NONE | TIMED=XXX}]
     [/Mode={NORMAL | ADVANCED}]
     [/ShowPrefs]

     Boot Manager from IBM, included with PartitionMagic, lets you quickly and easily
choose which operating system you want to start every time you start or restart your computer. 
You must install Boot Manager into free space outside any extended partition.  The Boot
Manager partition must be set as the active partition so that it loads first, prompting you to
choose an operating system.

     /Install -          This parameter tells the installation program to create a partition,
                         install Boot Manager, and set the newly created partition as the
                         active partition.  The user must specify whether the partition will
                         be created at the BEGINNING or END of free space.
     /ShowPrefs -        This parameter will cause the preference settings to be displayed.
     /StartupMenuDelay - This parameter allows you to specify how long the Boot Manager
                         startup menu, which comes up when you start your computer, will
                         be displayed before it starts an operating system.  The three choices
                         are Indefinite, None, and Timed.
                    Indefinite means that when you start your computer, the
                    Boot Manager startup menu will be displayed until you
                    choose which operating system to boot.
                    None means that Boot Manager will immediately start the
                    default operating system.
                    Timed means that Boot Manager will wait the amount of
                    time you specify before starting the default operating
                    system.  During this time, you can wait for the default
                    operating system, or you can choose a different operating
                    system to boot.  This option lets you specify a value
                    between 1 and 999 seconds.  When you install Boot
                    Manager, this preference is set as Timed and the default
                    time is 30 seconds.
     /Mode -        Mode refers to how much information Boot Manager displays on
                    the Boot Manager startup menu that appears when you start your
                    computer.  The two choices are Normal or Advanced.  The default
                    is Advanced.  
               Normal mode displays a list of names you assign to partitions
               containing operating systems.  You assign these names when you
               use the Add to Boot Manager Menu item.  Once they are added to
               the Boot Manager startup menu, these partitions are referred to as
               "bootable."
               Advanced mode displays this list and adds more information about
               the partitions.  In addition to the partition names, it will display the
               following:
                    The number of the physical disk the partition is on
                    The drive letter that would be assigned if it were started (if
                    you don't have NTFS drives)
                    Whether the partition is a primary or logical partition
                    The size of the partition
                    The partition type
                    Whether or not the partition is currently hidden
     /AddToMenu -   This parameter is used to place items on the Boot Manager startup
                    menu.  The startup menu items represent bootable partitions--those
                    containing operating systems.  In the text field, type the name that
                    you want to represent the selected partition on the Boot Manager
                    startup menu.  You can assign any name you want.  It can be up to
                    eight characters long, use uppercase and lowercase letters, and
                    include non-English characters, numerals, spaces, and symbols. 
                    Characters you access by pressing the Ctrl key and another key are
                    not allowed, however.  

               WARNING:  Do not add partitions to the Boot Manager startup
                         menu that do not contain operating systems.  You
                         will not be able to boot from those partitions.

     /ChangeName -  This parameter allows you to rename an item on the Boot Manager
                    startup menu.  In the text field, type the name that you want to
                    represent the selected partition on the Boot Manager startup menu.
     /SetAsDefault -     With this feature, you can set a default partition--the partition that
                         Boot Manager will select to boot the computer if you do not select
                         one before the time delay runs out.  If you do not set a default
                         partition, Boot Manager will start from the last partition your
                         computer started from if the time delay runs out before you select a
                         partition.
     /RemoveFromMenu -   This parameter is used to remove an item from the Boot Manager
                         startup menu.  As with most of the other parameters, this uses the
                         selected partition. 

Check
     Check the partition for errors.
     No Parameters.

Cluster Analyzer 

     [/ClusterSize={ 512 | 1 | 2 | 4 | 8 | 16 | 32 | 64 }]  
     [/ShowClusterWaste]
     [/SetToRecommended]
     
      Get Cluster Analysis information about a particular partition.
     If this operation is used with out any parameters it will output a Cluster Analysis screen.
     
     /ClusterSize - This parameter will change the cluster size to the specified size.
     /ShowClusterWaste - This parameter will show the Cluster Analysis Screen.
     /SetToRecommended - This parameter will set the ClusterSize to the recommended size.

Copy

     The Copy command should be preceded by the following commands:

     Select Drive {Num}
     Select Partition {PartitionLetter | "Volume Label" | Extended | Next | Previous | Num }
     Select Copy Drive {Num}
     Select Copy Partition {PartitionLetter | "Volume Label" | Next | Previous | Num }

     In order for the Copy command to work correctly a drive and partition need to be selected
     and a copy drive and copy partition need to be selected.  If the selected partition is free
     space and the partition specified by the copy partition is a partition smaller then the free
     space.  This operation will copy the specified partition to the free space.
     If the selected partition is a valid partition and the partition specified by the copy partition
     is a block of free space large enough to hold the partition, the copy operation will copy
     the selected partition to the specified free space.

Info 
     [/Usage ]
     [/Waste ]  
     [/Errors ]
     [/Partition ]
     [/FS]                 ------->     {FAT | HPFS | NTFS}

      Get Info about a particular partition.
     /Usage -  The Disk Usage screen is available for the FAT, FAT32, NTFS, and HPFS
               file systems.  This screen shows you the following information in bytes,
               megabytes, and as a percentage:
                    Used space on the partition, including space wasted by clusters
                    Free space on the partition
                    Bad space on the partition
                    Total space on the partition (found by adding the three previous
                    lines)
     /Waste -  The Cluster Waste screen applies only to partitions that use either the FAT
               or FAT32 file system.  This screen shows the following:
                    Current cluster size in bytes or kilobytes
                    Data stored on the partition in bytes and megabytes
                    Wasted space on the partition in bytes and megabytes
                    Total Used space in bytes and megabytes (found by adding the
                    numbers on the two previous lines)
     /Errors - The error screen applies to the FAT, FAT32, NTFS file systems.  Errors
               found during the check operation are displayed on this screen.
     /Partition -   This screen is available for all types of partitions, including free space and
                    extended partitions.  Information on this tabbed page includes the
                    following:
                    Partition type is shown in hexadecimal followed by a text
                    description of the partition or file system type (such as FAT,
                    FAT32, NTFS, HPFS, and so on).  The hexadecimal designation is
                    a conventional way to display partition types.
                    Serial Number is shown here if the partition's file system uses
                    serial numbers.  Not all file systems use serial numbers.
               The next section of the screen shows physical information about the
               partition, including the following:
                    First Physical Sector shows the logical number and the location
                    (cylinder, head, and sector) where the partition begins.
                    Last Physical Sector shows the logical number and the location
                    (cylinder, head, and sector) where the partition ends.
                    Total Physical Sectors gives the number of sectors in the
                    partition.
                    Physical Geometry shows the number of cylinders, heads, and
                    sectors of the physical disk drive on which the partition resides.
                    Boot Manager Name shows the volume name as it appears in the
                    Boot Manager menu, if you are running Boot Manager.  If the
                    partition is the Boot manager default selection, "Current Default"
                    will be shown in parentheses.
     /FS        FAT -    This screen applies only to partitions that use the FAT or FAT32
                         file system.  The first section on this page provides the following
                         information about the file system:
                    Sectors per FAT
                    Root directory capacity
                    First FAT sector
                     First Data sector  
               The next section of this page gives the following information:
                    Number of byes in files on the partition, the number of riles, and
                    the number of those files that are hidden
                    Number of bytes in directories on the partition, the number of
                     directories, and the number of those directories that are hidden
               Several extensions to the FAT file system exist.  The final section of this
               page gives the following information about FAT extensions:
                    Number of byes used for OS?2 Extended Attributes and how many
                    files and directories the Extended Attributes are associated with
                    Number of byes used for long file names and the number of files
                    and directories the long file names are associated with
     /FS     NTFS -      This screen contains information that pertains only to NTFS
                         partitions.  This screen shows the following file system
                         information for the selected partition:
                    NTFS Version shows the version number. The most recent version
                    is 1.2.
                    Bytes per NTFS sector displays the number of bytes in each
                    logical sector on the selected partition.  (There are always 512
                    bytes in each physical sector.)
                    Cluster size
                    First MFT Cluster 
                    File Record Size
               The next section shows information similar to that shown by NTFS
               CHKDSK, including the following:
                    Number of files and the byes and clusters allocated to them
                    Of the clusters used in files, the number of wasted bytes resulting
                    from the cluster size
                    Number in indexes (directories) and the space allocated to them,
                    shown in bytes and clusters
                    Space reserved for other system structures, shown in both bytes
                     and clusters  
     /FS     HPFS   This screen applies only to partitions that use the HPFS file system.  The
                    first section on this page provides the following information about the file
                    system:
                    Partition status    (i.e. is partition active)
                    DirBlock sectors
                    Free DirBlocks
                     Hot Fixes Used     
               The next section of this page gives the following information:
                    Number of bytes in files on the partition, the number of files, and
                    the equivalent amount of sectors
                    Number of bytes unused in file sectors
                    Number of bytes in directories on the partition, the number of
                    directories, and the equivalent number of sectors
                    Number of bytes in file/dir Fnodes and equivalent sectors
                     Number of bytes reserved by system and equivalent sectors
                     Number of bytes in extended attributes 

Label
     [/GetLabel ]
     [/SetLabel="" ]  

     This option allows you to change a partition's volume label.  Labels can be up to 11
     characters long and are shown in all capital letters.  Labels follow the same rules as DOS
     names, with two exceptions: 1) spaces are allowed, and 2) no dot is required between the
     first eight letters and the last three. 

Select Copy Drive {Num}
     Select among the physical drives.
     Num - Number of the drive to select starting at 1.
     
Select Copy Partition {PartitionLetter | "Volume Label" | Next | Previous | Num }
     Select the partition or free space
     PartitionLetter -
               The drive letter of the desired partition.
     Volume Label -
               The volume label of the desired partition. It must be in quotes.
     Next -    Must have had a partition selected previously. Do not use quotes.
     Previous -     Must have had a partition selected previously. Do not use quotes.
     Num -     Number of the partition or free block. This statement should always be
               preceded by a Select Drive statement. The first partition or free block on
               each drive is number 1. Partition numbers are displayed for each partition
               or free block if PartitionMagic is run interactively. This is the only way to
               select free space for creating a partition.

               EXTREME CAUTION should be used when selecting a partition by
               partition number as the numbers change as operations are performed. Once
               a partition is selected by number, it remains selected even if an operation
               changes the number of the selected partition.

Set FAT32 Options { ON | OFF | AUTO }

Set Ignore OS/2 EA Errors { ON | OFF }

Set NT 64K FAT Clusters { ON | OFF }

Show Copy Partitions 

     The Show Copy Partitions command should be preceded by the following commands:

     Select Drive {Num}
     Select Partition {PartitionLetter | "Volume Label" | Extended | Next | Previous | Num }
     Select Copy Drive {Num}

     In order for the Show Copy Partitions command to work correctly a drive and partition
     need to be selected and a copy drive needs to be selected.


Show Partitions

Show Preferences


4. Script Suggestions and Notes:

Although it is not necessary, it is recommend that each of the partitions to be modified be
checked at the first of the script.  Because the script file will terminate as soon as an error occurs,
checking each of the partitions first will keep the script from actually making any changes if any
errors are found up front.

Because the partitions must start on cylinder boundaries, occasionally when a number like 10
(MB) is specified, the real value that will need to be used will be something like 10.2 (MB). The
amount of difference from the value specified will depend on the geometry of the drive.  

When specifying an amount for one of the script options, the program will allow a margin of
error of 1 cylinder above or below that amount. (Or a range of 2 cylinders centered on the
amount specified). This means if an amount like 10 (MB) was specified for a resize, and a
cylinder was .5 (MB), that the operation would complete successfully if it can resize the partition
to at least 9.5 (MB).  The actual range would be 9.5 to 10.5 (MB).  If it could not resize the
partition within this range, it will return an error.  We would appreciate any feedback as to the
usefulness of a statement that would allow you to resize UP TO a value.  (Is it useful to be able to
say Resize to 10 (MB), and have the program resize to 5 if only 5 (MB) are available?)

Under normal operation, if the script determines that it will not be able to reboot the machine
after making the changes specified in the script, the script will terminate with an error.  This
condition will occur under OS/2 if the DOS.SYS file is not in the config.sys. (Such as booting
from the utility diskettes).  The ALLOW MANUAL REBOOT script statement should be put in
the script if performing a manual reboot from the keyboard is not a problem. It should be the first
statement in the script if used.

All commands must be contained within one line.  They may not be partially on one line and
finished on the next.  The maximum length of a script line is 180 characters which should be
sufficient for any command.

Extreme caution must be used selecting a partition by its number.  This feature must be available
to select free space or partitions that have no drive letter or label. The problem with selecting a
partition by number is that the numbers can and will change throughout the script.  If I select
partition #2 and move it to the right, any free space that has been moved from the right to the left
side of the partition will now become partition #2.  (The partition moved will still be selected
regardless of the number).  Using the Select Partition Next and Previous commands are usually
preferable to selecting free space by partition number. With most operations, the partition
selected after an operation will be the partition operated on.  For example, Resize and Move will
always leave the partition operated on as the selected partition after the operation. On a Create
command, the partition created will be selected after the command whether it is at the beginning
or end of the free space it was created in.  If there is any doubt as to which partition will be
selected after an operation, you can use the TTY version of the program (without scripting) and
perform the same operation on a test machine and observe which partition is selected after the
operation.  You can also use the Show Partitions command to show the current status of
partitions.
5. Sample Scripts:

Scenario 1     General Example
The user has C:, D:, and E: drives.  There is no free space on the disk.  All are primary partitions. 
The user wants to take 10 MB from D: and add it to E:.

SCRIPT1.FIL
//Check the partitions to be operated on first
Select Partition D
Check
Select Partition E
Check

//Select the first partition I want to change
Select Partition D

//Shrink the partition by 10 megabytes
Resize Smaller 10

//Select the partition to add the 10 meg to
Select Partition E

//Move the partition as far as possible to the left so that
// the free space just created will be on the left edge (the end)
Move Left Max

//Take up all of the available space 
Resize Larger Max


Scenario 2     General Example

The user has one large C: partition on the drive.  The drive is 1.2 Gigabytes in size.  The user has
only 300 MB of data on the partition and would like to create logical drives D and E.  The E
drive needs to be 300 MB and the rest of the disk space is to be split between the C and D drives. 

SCRIPT2.FIL
//Check the partition first
Select Partition C
Check

//Partition C is already selected so shrink it to 450 MB
Resize 450

//Since the C partition is still selected after the resize, we need to select the free space created
//after C.
Select Partition Next

//Create the extended partition to the default size, which will be all of the free space currently
//selected.
Create /FS=EXTENDED

//The Extended partition is now selected, and we want to select the next free space in the
extended partition.
Select Partition Next

//Create the partition that we need to be 300 MB first at the end of the free space that is currently
//selected. (What will be the E partition)
Create /FS=FAT /Label="DBFILES " /Size=300 /Position=END

//Select the rest of the free space within the extended partition.  Since the last partition was
//created at the end of the free space, we need to move to the free space previous to the selected
//partition
Select Partition Previous

//Create the partition in the rest of the free space
Create /FS=FAT /Label="APPS"



Scenario 3     General Example

The user has C:, D: and E: partitions on one physical drive.  There is no free space on the disk. 
The C partition is a primary partition and the D and E partitions are logical drives in an extended
partition.  The user wants to create an F: partition with 40 MB of free space that is in the C
partition. The F: partition will be a FAT partition with a volume label of "DATA" and since the
drive is fairly new, the user would like to skip bad sector testing for all operations. 

SCRIPT3.FIL
//Check all of the partitions first
Select Partition C
Check
Select Partition D
Check
Select Partition E
Check

//Since a partition on this drive had already been selected, we
// can set the default bad sector testing to off for this drive
Set Default Bad Sector Test State Off

//Select the C partition and shrink it by 40 MB
Select Partition C
Resize Smaller 40

//Select the extended partition and resize  the left boundary to the 
//right edge of the C partition (max), putting the free space within the 
// extended partition.  To Select an extended partition, the drive 
// must first be selected, and then the partition.
Select Drive 1
Select Partition Extended
Resize Left Boundary Max 

//Select the D partition and move it to the left, essentially
// flush against the Extended and C partitions, leaving the 
// free space between the D and E partitions
Select Partition D
Move Left Max

//Select the E partition and move it as far as possible to the 
// left, so that the free space will be at the end of E, within the 
// extended partition
Select Partition E
Move Left Max

//The free space is now after E and the user
// can create an F partition (logical drive)

//Move to the free space after E
Select Partition Next

//Create the FAT partition called DATA with all defaults.  This will use all of the size available
//in the free space.
Create /FS=FAT /Label="DATA"



 Scenario 4General Example

The user has a C partition which is a primary having 100 MB. The next partition is a hidden
partition called WARP_OS which is FAT and a primary partition at 100 MB.  There are also 2
logical drives, D and E in an extended partition which are each 70 MB.

The user wants to reduce both the C and Hidden partitions to 60 MB, add 40 MB to the D
partition, and create an F partition (HPFS) with the remaining free space.  The user also wants to
convert the hidden partition from FAT to HPFS.  The user also does not care whether the
machine can reboot under program control or not.

SCRIPT4.FIL
//Inform that a manual boot is acceptable
Allow Manual Reboot

//Check all of the partitions first
Select Partition C
Check
//The hidden partition is selected by using the volume label in quotes
Select Partition "WARP_OS"
Check
Select Partition D
Check
Select Partition E
Check

//Select the C Partition and resize it to 60 MB
Select Partition C
Resize 60

//Select the hidden partition
Select Partition "WARP_OS"

//Move the partition flush against the C partition (since it was just resized) putting the 
// newly created free space after the hidden partition
Move Left Max

//Resize the hidden partition to 60 MB
Resize 60

//Convert the partition from FAT to HPFS
Convert To HPFS

//Expand the extended partition so that the free space is now
// inside the expanded partition
Select Drive 1
Select Partition Extended
Resize Left Boundary Max

//Move the D partition flush against the hidden and extended partitions
Select Partition D
Move Left Max

//Add 40 MB to the D partition
Resize Larger 40

//Move the E partition next to the D partition
Select Partition E
Move Left Max

//The Free space is now available at the end of the extended 
// partition so that the user can create an F logical drive. Select the free space
//Select partition Next

//Create the HPFS partition.
Create /FS=HPFS






















 Scenario 5Advanced Fat Properties Examples

The user has a single C partition on his 1.6 GB Drive.  He would like to use advanced FAT
properties to get more information about the FAT partition and then use it to resize the partition.

Select Drive 1
Select Partition 1

// Get information about the FAT partition
Advanced FAT Properties  /ShowProps

Now that the user has obtained the FAT property information he would like to resize the partition
to 800 MB using Advanced FAT Properties.  He would like to label this as the Windows 95
drive.  He would also like to give it the maximum number of Root Directory entries.  He would
then like to create an extended partition and divide it into two logical drives.

// Resize Partition 1
Select Drive 1
Select Partition 1
Advanced FAT Properties /FS=FAT /Label="Win 95" /Size=800 /RootEntries=1024

// Create the Extended Partition
Select Partition Next
Create /FS=EXTENDED

// Create First Logical Drive
Select Partition Next
Create /FS=FAT /Label="OS2" /Size=400

// Create Second Logical Drive
Select Partition Next
Create /FS=FAT /Label="Data"


 Scenario 6Boot Manager

The user has a C partition that is 200 MB and a hidden C partition that is 200 MB and an
extended partition that is 600 MB that has a D and E logical drive.  The last partition is the 2 MB
primary partition that holds Boot Manager.   Partition D has the OS/2 operating system on it.
Partition C, hidden C, D, and Boot Manager are on the boot manager menu.

The user would like to move Boot Manager that is on a primary partition at the front of his disk
to a primary partition at the end of his disk.  He would like to remove all references to the old
Boot Manager setup.  He would then like to install Boot Manager on the primary partition he has
created at the beginning of the disk and add the boot partitions to the Boot Manager menu.  He
would also like to set one partition to be the default partition.  There is no free space on his drive.

After he is done this, he decides he would like the boot manager menu to show more information
and that he would like to change one of the names on the boot manager menu.  He would also
like boot manager to have a delay of two minutes.

// Select Partition C
Select Drive 1
Select Partition 1
Boot Manager /RemoveFromMenu

// Select the hidden C partition
Select Partition Next
Boot Manager /RemoveFromMenu

// Partition 3 is the extended partition
Select Partition Next

// This is Partition 4 or the D drive that has OS2
Select Partition Next
Boot Manager /RemoveFromMenu

// Select Partition 5 or the E logical drive
Select Partition Next

// Select Partition 6 or the Boot Manager partition
Select Partition Next
delete "Boot Man"        // "Boot Man" is the volume name

// Select the C Partition and create a place for Boot Manager
Select Partition 1
Resize Smaller Min
Move Left Max

// This selects the free space that is now in front of the C partition
Select Partition 1
// Boot Manager is installed on this partition and set as the default
Boot Manager /Install=BEGINNING
Boot Manager /SetAsDefault

// Select the C partition
Select Partition 2
Boot Manager /AddToMenu="Win95"

// Select the hidden C partition
Select Partition 3
Boot Manager /AddToMenu="Win31"

// Select the Extended Partition and Expand it to include space at end
Select Partition Next
Resize Max

// Select the D logical Drive
Select Partition Next
Boot Manager /AddToMenu="OS2"

// Select the E logical Drive and expand it to include empty space
Select Partition Next
Resize Max

// At this point the user is done but he would like to change the boot manager menu to show more
// information and he would like to change one of the names on the boot manager menu.  He 
// would also like boot manager to have a delay of two minutes.

// This commands shows the user what the current Boot Manager preferences are set at
Boot Manager /ShowPrefs

// Set Advanced Mode
Boot Manager /Mode=ADVANCED

// Set Delay to 2 minutes
Boot Manager /StartupMenuDelay=Timed=2

// The user wants to change the name of Windows 3.11 on the Boot Manager Menu
Select Partition 3
Boot Manager /ChangeName="Win311"
 Scenario 7Cluster Analyzer

The user has a 3.2 GB drive.  He has a Boot Manager partition that is a primary and is 2 MB in
size.  He has a C partition which is a primary FAT partition that is 1 GB.  He also has a hidden
primary FAT partition that is 1 GB.  He likes to boot multiple operating systems and the third
partition holds another operating system.  He also has an extended partition with logical drives
that uses up the rest of the drive space. 

The user would like to analyze the two FAT partitions to see if he can reduce the cluster waste.

// Show Cluster Waste for Partition 2
Select Drive 1
Select Partition 2
Cluster Analyzer /ShowClusterWaste

// Show Cluster Waste for Partition 3
Select Drive 1
Select Partition 3
Cluster Analyzer /ShowClusterWaste

The user can now see that he can reduce cluster waste so he will use the Cluster Analyzer to
reduce waste again.  He will set the third partition to the recommended size and the second
partition to a cluster size of 8K.

// Set Partition 3 to Recommended Cluster Size
Select Drive 1
Select Partition 3
Cluster Analyzer /SetToRecommended

// Set Partition 2 to 8K Clusters
Select Drive 1
Select Partition 2
Cluster Analyzer /CusterSize=8



 Scenario 8Copy

The user has just installed a new drive he would like to copy the first three partition on drive 1 to
drive 2.  Drive 2 is formatted and is free space.  This is accomplished as follows:

// Select Drive 1, Partition 1
Select Drive 1
Select Partition 1

// Select Copy Drive 2, Copy Partition 1
Select Copy Drive 2
Select Copy Partition 1

// Copy First Partition
Copy

// Select Drive 1, Partition 2
Select Partition 2
// Select Copy Drive 2, Copy Partition 2
Select Copy Partition 2

// Copy Second Partition
Copy

// Select Drive 1, Partition 3
Select Partition 3
// Select Copy Drive 2, Copy Partition 3
Select Copy Partition 3

// Copy Third Partition
Copy Scenario 9Info

The user has a FAT partition out on Partition C that he would like to get some information about. 
He doesn't know how big the partition is or much about it.  He would like to know about the disk
usage, the cluster waste, partition information, file system information and find out if there are
any errors.

Select Drive 1
Select Partition 1
Info /Usage /Waste /Errors /Partition /FS
 

This could also be accomplished as follows
Select Drive 1
Select Partition 1
Info /Usage
Info /Waste
Info /Partition
Info /FS
Info /Errors
6. Scripting commands added for 2.0

Bad Sector Retest

Create /FS={FAT | HPFS | EXTENDED | UNFORMATTED}
     [/Label="NEW LABEL"]
     [/Size=Value] 
     [/Position={BEGINNING | END}]
     [/Clustersize={ 512 | 1 | 2 | 4 | 8 | 16 | 32 }]  
     [/RootEntries=Value]
     [/BadSectorTest={ ON | OFF}]

 Delete{Volume Name | "NO NAME" | "UNKNOWN" }

Format {Volume Name | "NO NAME" | "UNKNOWN" }
     /FS={ FAT | HPFS }
     [/Label="NEW LABEL"]
     [/Clustersize={ 512 | 1 | 2 | 4 | 8 | 16 | 32 }]  
     [/Rootentries=Value]
     [/BadSectorTest={ ON | OFF}]

Hide

Resize Clusters {Value | Min | Max }      
Resize Root {Value | Min | Max }

Set Active
     
Set Default Bad Sector Test State { ON | OFF}     //for the cur selected drive

Unhide

Changed in old scripting:

All of the following support the /CLUSTERSIZE=512|1|2|4|8|16|32  option  

Resize {Max | Min | Value } [/Clustersize={512 | 1 | 2 | 4 | 8 | 16 | 32 }]
Resize Larger {Max | Min | Value}  [/Clustersize={512 | 1 | 2 | 4 | 8 | 16 | 32 }]
Resize Smaller {Max | Min | Value}   [/Clustersize={512 | 1 | 2 | 4 | 8 | 16 | 32 }]
Resize Space After {Max | Min | Value}  [/Clustersize={512 | 1 | 2 | 4 | 8 | 16 | 32 }]



These statements can be used to select free space
Select Partition { Num }
Select Partition { Next }
Select Partition { Previous }
  7. What's new in 3.0

Advanced FAT Properties 
     [/FS={ FAT | FAT32 } ]
     [/Label=""] 
     [/Size=value ]
     [/ClusterSize={ 512 | 1 | 2 | 4 | 8 | 16 | 32 | 64 } ]
     [/RootEntries=value ]         // This is not necessary and not allowed for FAT32
     [/ShowProps]

Boot Manager 

     [/Install={BEGINNING | END}]
     [/AddToMenu="MenuNameText"]
     [/ChangeName="MenuNameText"] 
     [/SetAsDefault]
     [/RemoveFromMenu]
     [/StartupMenuDelay={INDEFINITE | NONE | TIMED=XXX}]
     [/Mode={NORMAL | ADVANCED}]
     [/ShowPrefs]

Cluster Analyzer 

     [/ClusterSize={ 512 | 1 | 2 | 4 | 8 | 16 | 32 | 64 }]  
     [/ShowClusterWaste]
     [/SetToRecommended]
     
Copy

Info 
     [/Usage ]
     [/Waste ]  
     [/Errors ]
     [/Partition ]
     [/FS]

Label
     [/GetLabel ]
     [/SetLabel="" ]  


Select Copy Drive {Num}
     
Select Copy Partition {PartitionLetter | "Volume Label" | Next | Previous | Num }

Set FAT32 Options { ON | OFF | AUTO }

Set Ignore OS/2 EA Errors { ON | OFF }

Set NT 64K FAT Clusters { ON | OFF }

Show Copy Partitions 

Show Partitions

Show Preferences


Changes in 2.0 scripting:

A number of features have been enhanced or streamlined for 3.0.  The changes in the scripting
commands are based on the changes that have been made to PartitionMagic 3.0.

The following scripting commands have been modified:

Create and Format no longer support Clustersize, RootEntries or BadSectorTest.  They now
support the NTFS file system.

Create /FS={FAT | HPFS | NTFS | EXTENDED | UNFORMATTED}
     [/Label="NEW LABEL"]
     [/Size=Value] 
     [/Position={BEGINNING | END}]

Format {Volume Name | "NO NAME" | "UNKNOWN" }
     /FS={ FAT | HPFS | NTFS }
     [/Label="NEW LABEL"]

The following Resize commands now support 64K Clusters:

Resize {Max | Min | Value } [/Clustersize={512 | 1 | 2 | 4 | 8 | 16 | 32 | 64}]
Resize Larger {Max | Min | Value}  [/Clustersize={512 | 1 | 2 | 4 | 8 | 16 | 32 | 64 }]
Resize Smaller {Max | Min | Value}   [/Clustersize={512 | 1 | 2 | 4 | 8 | 16 | 32 | 64 }]
Resize Space After {Max | Min | Value}  [/Clustersize={512 | 1 | 2 | 4 | 8 | 16 | 32 | 64 }]

The check command has been enhanced in 3.0.

Check