AOMEI Partition Assistant Command Lines
Export Execution Results to File
Because this command execution cannot use the ">" symbol to export execution results to file, so we specially add /out parameter for exporting execution results to file, which supports to export execution results of all command lines to file. The examples are as follow:

- partassist.exe /list /out:text.txt
- partassist.exe /resize:F /extend:right /out:c:\test.ini
- partassist.exe /hd:0 /cre /pri /size:200GB /out:..\..\test.txt

List Disks and Partitions

- List all the disks in current system.
- partassist.exe /list

- Only list all the USB flash drives and other USB disks in current system.
- partassist.exe /list /usb

- List all the partitions on a specified disk.
- partassist.exe /list:0

Resize Partition without Data Loss

- Automatically extend a specified partition using the unallocated space on its both sides and align partition to optimize reading/writing speed.
- partassist.exe /hd:0 /resize:0 /extend:auto /align
- partassist.exe /resize:F /extend:auto /align

- Automatically extend a specified partition using the unallocated space on its right side.
- partassist.exe /hd:0 /resize:0 /extend:right
- partassist.exe /resize:F /extend:right

- Automatically extend a specified partition using the unallocated space on its left side and align the partition to optimize reading/writing speed.
- partassist.exe /hd:0 /resize:0 /extend:left /align
- partassist.exe /resize:F /extend:left /align

- Extend a specified partition using 1000MB or 10GB unallocated space on its right side.
- partassist.exe /hd:0 /resize:0 /extend:1000
- partassist.exe /hd:0 /resize:0 /extend:10GB

- Shrink a specified partition to create 1000MB or 10GB unallocated space on its right side.
- partassist.exe /hd:0 /resize:0 /reduce-right:1000
- partassist.exe /resize:F /reduce-right:10GB

- Shrink a specified partition to create 1000MB or 10GB unallocated space on its left side and align the partition to optimize reading/writing speed.
- partassist.exe /hd:0 /resize:0 /reduce-left:1000 /align
- partassist.exe /resize:F /reduce-left:10GB /align

Notes:

- /hd followed by disk number, which starts with 0.
- /resize followed by partition number or drive letter, and the partition number starts with 0. If the specified value is drive letter, disk number can be ignored.
- The value of /extend can be left, right, auto or specified size.
- /align means align a partition to optimize reading/writing speed. If the beginning of a partition is changed when resizing it (in other words, move the beginning of a partition to a new location, forward or backward), then the /align works. But if the beginning of a partition is not changed when resizing it, then the /align doesn’t works.
- By default, the specified size is in MB, and GB is also available.

Move a Partition without Data Loss

- Change the location of a partition by moving 1000MB or 10GB to the left side and align the partition to optimize reading/writing speed.
- partassist.exe /hd:0 /move:0 /left:1000 /align
- partassist.exe /move:F /left:10GB /align

- Move a partition to occupy all unallocated space on its left side and align the partition to optimize reading/writing speed.
- partassist.exe /hd:0 /move:0 /left:auto /align
- partassist.exe /move:F /left:auto /align

- Change the location of a partition by moving 1000MB or 10GB to the right side and align the partition to optimize reading/writing speed.
- partassist.exe /hd:0 /move:0 /right:1000 /align
- partassist.exe /move:F /right:10GB /align

- Move a partition to occupy all unallocated space on its right side and align the partition to optimize reading/writing speed.
- partassist.exe /hd:0 /move:0 /right:auto /align
- partassist.exe /move:F /right:auto /align

Notes:

- /hd followed by disk number, which starts with 0.
- /move followed by partition number or drive letter, and the partition number starts with 0. If the specified value is drive letter, disk numberan be ignored.
- The value of /left can be auto or specified size.
- The value of /right can be auto or specified size.
- /align means creating aligned partition to optimize reading/writing speed.
- By default, the specified size is in MB, and GB is also available.

Create a New Partition

- Create a 200MB, 10GB or auto size partition at the end of a disk.
- partassist.exe /hd:1 /cre /pri /size:200 /end /fs:fat16 /act /hide /align /label:EFI
- partassist.exe /hd:1 /cre /pri /size:10GB /end /fs:fat32 /act /hide /align /label:EFI
- partassist.exe /hd:1 /cre /pri /size:auto /end /fs:ntfs /act /hide /align /label:EFI
- Create an auto size or 500MB partition using the first block of unallocated space on a disk.
- partassist.exe /hd:0 /cre /pri /size:auto /fs:ntfs /align /label:DATA /letter:E
- partassist.exe /hd:0 /cre /pri /size:500 /fs:ntfs /align /label:DATA /letter:E

- Create a partition using offset. Here is creating a partition at the location of 100MB offset and 100GB offset.
- partassist.exe /hd:0 /cre /pri /size:auto /offset:100 /fs:fat32 /act /align /label:DATA /letter:F
- partassist.exe /hd:0 /cre /pri /size:10GB /offset:100GB /fs:fat32 /act /align /label:DATA /letter:F

Notes:

- /hd followed by disk number, which starts with 0.
- The value of /size can be auto or specified size in MB by default, and GB is also available.
- /fs means file system, whose value can be fat16, fat32 or ntfs.
- /pri means creating a primary partition.
- /act means creating an active partition.
- /hide means creating a hidden partition.
- /letter means assigning a drive letter to the partition, in addition, /letter:auto can automatically assign the drive letter.
- /offset means creating a partition from the location of specified offset, starting with the beginning of the disk.
- /label means setting a label for the partition.
- /end means creating a specified size back end partition using the unallocated space at the end of a disk.

Format a Partition

- Format a specified partition
- partassist.exe /hd:0 /fmt:0 /fs:fat16 /label: test
- partassist.exe /fmt:F /fs:fat32 /label:test
- partassist.exe /fmt:F /fs:ntfs /label:test

Notes:

- /hd followed by disk number, which starts with 0.
- /fmt followed by partition number or drive letter, and the partition number starts with 0. If the specified value is drive letter, disk number can be ignored.
- /fs means file system, whose value can be fat16, fat32 or ntfs.

Delete a Partition

- Delete a specified partition
- partassist.exe /hd:0 /del:0
- partassist.exe /del:F

- Delete all the partitions on a disk
- partassist.exe /hd:0 /del:all

Hide a Partition

- Hide a specified partition
- partassist.exe /hd:0 /hide:0
- partassist.exe /hide:F

- Unhide a specified partition
- partassist.exe /hd:0 /unhide:0

Mark Partition as Active

- partassist.exe /setact:1 /hd:0
- partassist.exe /setact:F

Initialize a Disk

- Initialize a disk as MBR
- partassist.exe /init:1

- Initialize a disk as GPT
- partassist.exe /init:1 /gpt

Rebuild MBR

- Rebuild Master Boot Record (MBR) for Hard Disk, Removable Disk, USB Flash Drive, etc.
- partassist.exe /rebuildmbr:0
- partassist.exe /rebuildmbr:0 /mbrtype:0
- partassist.exe /rebuildmbr:0 /mbrtype:1
- partassist.exe /rebuildmbr:0 /mbrtype:2

Notes:

- /rebuildmbr followed by disk number, which starts with 0.
- /mbrtype supports specified MBR type and its values are 0, 1, 2. The 0 means creating a Windows XP/2000/20003 MBR type. The 1 means creating a Windows Vista/2008 MBR type. The 2 means creating a Windows 7/8/8.1/10/2008(R2)/2011/2012/2012(R2)/2016 MBR type.
- If the value of /mbrtype is not specified, the default type is the one of current system. For example, if current system is Windows XP, then the value of /mbrtype is set as 0 by default; if current system is Windows 8.1, then the value of /mbrtype is set as 2 by default.

Change Drive Letter

- Remove drive letter
- partassist.exe /hd:0 /setletter:0 /letter:*

- Change drive letter to F
- partassist.exe /hd:0 /setletter:0 /letter:F

Notes:

- /hd followed by disk number, /setletter followed by partition number, and the disk number and partition number always start with 0.
- If a drive letter needs to be removed, you need to set /letter value as *
- You had better not to remove and change the drive letter of system partition, which may cause Windows to fail to boot.
- If you use "/letter auto" to replace "/letter:F", the drive letter will be assigned automatically.

Write Files to a Hidden Partition

- Write files and folders to the root directory of a hidden partition
- partassist.exe /hd:0 /whide:0 /src:C:\file.txt
- partassist.exe /hd:0 /whide:0 /src:C:\folder

- Write files and folders to the subdirectory of a hidden partition
- partassist.exe /hd:0 /whide:0 /src:C:\file.txt /dest:subfolder
- partassist.exe /hd:0 /whide:0 /src:C:\folder /dest:subfolder\test

Notes:
Before using the /resize and /move of AOMEI Partition Assistant Command Line, we suggest you use Windows built-in chkdsk utility to check the partition you want to resize and automatically fix file system error so that the data safety can be ensured effectively. Example: chkdsk.exe /f C: