// PartitionMagic Script File

// This script file is an example of creating a logical partition using space
// taken from a primary partition

// Scenario:
// A disk contains a primary C: partition and logical partitions D: and E:.
//
// The user wishes to take 40 MB of unused space from the C: partition and 
// create a logical partition with "Data" as its label.

// Check the partitions for errors before making any changes
Select Partition C
Check
Select Partition D
Check
Select Partition E
Check

// Resize the C: partition to be 40 MB smaller
Select Partition C
Resize Smaller 40

// Select the extended partition and move it to fill the unallocated space
Select Partition Extended
Resize Left Boundary Max

// Move the D: and E: partitions to the beginning of the extended partition
Select Partition D
Move Left Max
Select Partition E
Move Left Max

// Create the new partition at the end of the extended partition
Select Unallocated After Selected Partition
Create /FS=FAT /Label="Data"