If I create an expandable Virtual Hard Drive (VHD) with a maximum size of 50Gb, fill it with 48Gb of files, and then reduce that amount to 25Gb, what is the most efficient and sure-fire way of reducing the size of the VHD so that it is only 25Gb or thereabouts.
I'd like to do this without having to copy the contents of the VHD into a fresh one, or having to have twice the amount of space available for any reason.
I am aware that diskpart's VHD COMPACT doesn't recover all the space.