MyDefrag (formerly JkDefrag) is a freeware disk defragmenting utility for Windows. JkDefrag was developed by Jeroen Kessels from 2004. The major change between JkDefrag and MyDefrag is the inclusion of a scripting language. This permits control of all the algorithms and techniques used in MyDefrag. A number of pre-written scripts intended for common usage scenarios are included, such as those for system hard disks, data hard disks, solid state media, consolidation of free space, fast or thorough defragmention, and the ability to lay files out on disk exactly where required, sorted by filename, access time, size, etc. The scripts provided cater for the usual tasks; but while scripts offer great flexibility, any task not covered by an existing script (an example given in a review: defragging only movie files over 50 meg which have not been accessed since last year) requires the user to write the required script, not simple for a novice.
A feature unique to MyDefrag is wrap-around fragmentation, which, when enabled by default, will surround unmovable sectors with otherwise defragmented data. This is done to minimize the number of empty gaps between files and to load more data into the faster regions of hard disks. MyDefrag has a graphical user interface, which can be used to load and monitor scripts. Scripts designed for use on system disks will use prefetch data present in Windows about the most commonly used files in order to optimize boot and program performance.
MyDefrag is the continuation of Kessels's open source program JkDefrag with many changes and is distributed free of charge under a closed source license. In a forum post, Kessels mentioned that one reason for switching to a closed-source model was the lack of donations, although the source code is available for a fee.
Like JkDefrag, MyDefrag uses the standard Windows defragmentation API to perform all file system operations.