Yeah, I work with VMs a lot and having their disk image files fragmented can really kill performace, so I’ve been playing with defrag utils a bit. SysInternals also do a “contig” util that does single-file defrags and that is quite useful for VMs. I’m currently a fan of PerfectDisk after testing DiskKeeper and getting annoyed that it would regularly put the big files in its “too hard” basket (and it’s the big files that I care about). However it has better options for playing with the MFT etc. Interested to see whether there are better options.
I had been using similar VBScript to defrag my HD regularly Except that I need to exclude a drive (“S” to be exact for my source codes) being a result of “subst”.
A nice feature of the newer versions of Diskeeper is that they will stop themselves if disk activity becomes high… so if you start a high-demand activity while a background defrag is running, the defrag will back off until the disk demand drops.
Windows is just trying to do what linux has been doing right for years (cleaning out all the temp files, etc). Except it’s not necessary to defragment in linux.