Resizing partition with DiskPart using desired and minimum options is unsuccessful

Have/Had similar issues/question, so documenting my findings.

From https://docs.microsoft.com/en-us/windows-server/storage/disk-management/shrink-a-basic-volume

When you shrink a partition, certain files (for example, the paging file or the shadow copy storage area) cannot be automatically relocated, and you cannot decrease the allocated space beyond the point where the unmovable files are located

This is probably not the case in the above scenario but might be worth remembering.

desired is "how much smaller" you want the device to be, so in this case making it 250000 smaller than what it currently is, would make it smaller than the tested and ok 230GB.

I know it is confusing that desired is not the desired final size, but the shrinkage.

Example: shrink desired=100 minimum=10 Should try to make the volume 100MB smaller, but it will still shrink it if it can only reclaim 10MB.

Or for the specific question, maybe shrink desired=230000 minimum=100000 would have been the answer.

More detailed explanations of errors do show up in the Windows Event Application log.