How to Run Disk Defragmenter as a Scheduled Task
Command Line Kung Fu
I was trying to figure out how to run Disk Defragmenter from the command line on a SBS2003 box as I was not sure how to specify what drive I want defrag.exe to run on at a specific time. Turns out that you can just browse to defrag.exe (…/system32) and then tell it what drive to run on in the advanced properties of the Task Scheduler. Microsoft has a write-up on the whole process.