JKDefrag, long one of my favorite disk defrag programs, is now MyDefrag. It’s still the same great utility that’s very stable, free and easy to use, but it now has a scripting engine to allow you to create scripts to run it exactly the way you want it. There are more to configure this time, from how long the defrag should run to whether or not for it to reboot when it’s finished. The scripting language is fairly simple to learn.
Although MyDefrag now requires installation, it will still run portably from your USB key drive. Just copy the program folder structure to your USB drive and delete the unins000.exe, unins000.dat and uninstall.exe files. I noted the various defrag methods in its start menu and made a series of VB Scripts to launch that method from my USB key drive.
Analyze Only
Set objShell = CreateObject(“Wscript.Shell”)
objShell.Run(“MyDefrag.exe -r AnalyzeOnly.MyD”), 1, TRUE
Defragment Only
Set objShell = CreateObject(“Wscript.Shell”)
objShell.Run(“MyDefrag.exe -r DefragmentOnly.MyD”), 1, TRUE
Fast Optimize
Set objShell = CreateObject(“Wscript.Shell”)
objShell.Run(“MyDefrag.exe -r FastOptimize.MyD”), 1, TRUE
Fast Update
Set objShell = CreateObject(“Wscript.Shell”)
objShell.Run(“MyDefrag.exe -r FastUpdate.MyD”), 1, TRUE
Flash Memory Disk Optimization
Set objShell = CreateObject(“Wscript.Shell”)
objShell.Run(“MyDefrag.exe -r FlashMemoryDisks.MyD”), 1, TRUE
Slow Optimize (Very thorough defragmentation)
Set objShell = CreateObject(“Wscript.Shell”)
objShell.Run(“MyDefrag.exe -r SlowOptimize.MyD”), 1, TRUE
In MyDefrag’s scripts folder is a file called Settings.MyD that stores the basic settings, and it is here that you configure the option for what should happen after the defrag is finished. By default the program window stays open, but you can change it so it automatically quits. Just change line 16 to:
WhenFinished(exit)
I use MyDefrag at work as part of the monthly maintenance I do on the computers there. The last thing I do is a disk defrag as it often takes a long time to run, so it makes good sense to have the program automatically quit so the computer can reboot, thus allowing me to exit stage right, unnoticed.