Computer and Software Support


 Compact

DiskPart 

This is from Microsoft Technet. If you want to see it at their site, click here

To access DiskPart, click here

Reduces the physical size of a dynamically expanding virtual hard disk (VHD) file. This parameter is useful because dynamically expanding VHDs increase in size as you add files, but they do not automatically reduce in size when you delete files.

NOTE: This command is only applicable to Windows 7 and Windows Server 2008 R2.

Syntax: compact vdisk

Remarks

  • A dynamically expanding VHD must be selected for this operation to succeed. Use the select vdisk command to select a vhd and shift the focus to it.

  • You can only compact dynamically expanding VHDs that are detached or attached as read-only.

 

Examples

To compact a dynamically expanding VHD, type:

Compact vdisk