If your system is running low on storage, you may want to merge unallocated space to C drive using CMD. Windows includes a built-in command-line tool called diskpart that can help you extend partitions. This guide covers how to use diskpart, what to do when another partition sits in the way, and why many users prefer a free tool like IM-Magic Partition Resizer.

You can only add unallocated space to C drive using diskpart when the unallocated space is located immediately to the right of the C partition on the same disk. Diskpart does not allow moving partitions, so the layout must already be correct.
cmd → right-click → Run as administrator.diskpart.list volume to see partition numbers.select volume X (replace X with the C drive volume number).extend or extend size=XXXX (in MB).exit.Example commands:
diskpart
list volume
select volume 2
extend
Diskpart cannot move partitions, so if another volume sits in between, you cannot extend C using CMD alone. In such a layout, you may use free tool IM-Magic Partition Resizer.
As a significantly easier approach, IM-Magic Partition Resizer lets you visually move partitions, merge unallocated space, and expand the C drive without deleting volumes or using command-line instructions.
Video: How to create and move unallocated space to C drive
For Windows 11/10/8/7 => Download Partition Resizer Free [100% Free]
For Windows Server 2025-2003 => Download Partition Resizer Server [Free Demo]
Key advantages:
Also read: How to merge unallocated space to c drive
Free tool IM-Magic Partition Resizer includes disk cloning and partition copy features that help you back up your disk and its data. The cloning process creates a 1:1 copy, preserving disk properties and all related information.
Also read: How to back up disk or partition
diskpart to extend C drive once the free space is contiguous. No. You may shrink the volume if supported, or restore from backup. Always create backups before resizing any partition.
No, diskpart does not delete C drive data when extending. However, modifying partitions always carries risk, so backing up is recommended.
IM-Magic Partition Resizer is widely used for non-destructive partition resizing, and it provides a safer method for moving partitions compared to manual command-line steps.
To summarize: You can merge unallocated space to C drive using CMD only if the unallocated space is already contiguous. If not, consider using IM-Magic Partition Resizer to move or merge partitions safely and easily.