Vista accepts the command however spends about 2 minutes churning over the hard disk to eventually fail.
Clearly the layout of the disk is a problem, although Vista doesn't give me any clues to what's happening. On another track, I've been looking at HDD fragmentation and I now have PerfectDisk 8.0 installed on my laptop. (**Disclaimer** I paid for this software!).
There's an unmovable file at the end of the C:\ drive, indicated by the red areas. Unfortunately PerfectDisk doesn't identify what specific file this is, although I know it is likely to be the page/swap file, the hibernation file or other control areas for NTFS.
I performed an offline defrag to tidy the NTFS areas however this didn't resolve the problem. I then removed completely the swap file and this turned out to be the file holding this space. I could then run shrink and reclaim my 40GB of space, which I've allocated to a swap volume and a data volume.
The shrink command is helpful, but it would be more helpful if the results were consistent and the command didn't simply fail when the free space isn't at the end of the volume. It also rather annoying that Microsoft has removed the graphic representation of a fragmented volume from their built-in defrag tool. Defrag can be run from the command line; try defrag c: -a -v from a command window. The output is not particularly helpful
Analysis report for volume C: OS
Volume size = 103 GB
Cluster size = 4 KB
Used space = 85.75 GB
Free space = 17.57 GB
Percent free space = 17 %
Percent file fragmentation = 1 %
Total movable files = 121,296
Average file size = 633 KB
Total fragmented files = 659
Total excess fragments = 4,104
Average fragments per file = 1.03
Total unmovable files = 21,926
Free space fragmentation
Free space = 17.57 GB
Total free space extent = 86
Average free space per extent = 209 MB
Largest free space extent = 11.10 GB
Total folders = 17,206
Fragmented folders = 38
Excess folder fragments = 772
Master File Table (MFT) fragmentation
Total MFT size = 141 MB
MFT record count = 144,197
Percent MFT in use = 99
Total MFT fragments = 2
...and is certainly not graphical.
I suggest finding a good defragmentation tool - I don't care which one, but one that can (a) move/reorganise system files (b) display a graphical representation of the volume, including identifying individual files and (c) will consolidate freespace.