The WMI Defrag action allows you to analyse the fragmentation and perform a defragmentation of a logical drive via WMI.
The WMI Defrag only works on Windows 2003 and Windows Server "Longhorn" operating systems. To Defrag on other OS's, use the Defrag Disk Action action.
Enter the name of the remote machine, or leave blank for localhost
Select the drive letter. If you want to set this dynamically, set it in the BeforeAction script event. See below.
Select if you want to perform an analysis or a defragmentation
If the volume doesn't require defragmentation, setting this option will force the defrag anyway
If performing an analysis, the recommendation will be set to this variable, true for defrag recommended
Select the variable to save the analysis report to. The report will also be output to the log.
You can set the various properties of the action via script. For example, to set the Drive Letter via script:
Where "TheDriveLetter" is a variable that has been set to a valid drive on the machine, in the format <DriveLetter>:
eg. E: or C: