Разгледай в хелпа командата
>diskpart с параметър extent
Може и да не ти се наложи да се правиш на дайнамик.
Код:
DiskPart
DiskPart.exe is a text-mode command interpreter that enables you to manage objects (disks, partitions, or volumes)
by using scripts or direct input from a command prompt.
...
extend
Extends the volume with focus into next contiguous unallocated space. For basic volumes, the unallocated space
must be on the same disk as, and must follow (be of higher sector offset than) the partition with focus.
A dynamic simple or spanned volume can be extended to any empty space on any dynamic disk. Using this command,
you can extend an existing volume into newly created space.
If the partition was previously formatted with the NTFS file system, the file system is automatically extended to
occupy the larger partition. No data loss occurs. If the partition was previously formatted with any file system format
other than NTFS, the command fails with no change to the partition.
You cannot extend the current system or boot partitions.
Syntax
extend [size=n] [disk=n] [noerr]
Parameters
size=n
The amount of space, in megabytes (MB), to add to the current partition. If you do not specify a size, the disk
is extended to take up all of the next contiguous unallocated space.
disk=n
The dynamic disk on which to extend the volume. An amount of space equal to size=n is allocated on the disk.
If no disk is specified, the volume is extended on the current disk.
noerr
For scripting only. When an error is encountered, specifies that DiskPart continue to process commands as if the
error did not occur. Without the noerr parameter, an error causes DiskPart to exit with an error code.
...