Defragmentation can be easily fully automated. Just click Settings > Preferences, open the Automatic defragmentation tab, select the disks you would like to defragment automatically and click OK.
By default the program performs automatic defragmentation once a day when the computer is idle. To adjust defragmentation schedule click Settings > Preferences, open the Automatic defragmentation tab and click Schedule. Alternatively, you can adjust the schedule directly in Windows Task Scheduler.
- Note
- By default the automatic defragmentation will not be performed when the computer runs on batteries.
- To prevent waste of time the program disables the following built-in task on Windows Vista and more recent Windows editions:
Task Scheduler Library\Microsoft\Windows\Defrag\ScheduledDefrag.
Also it is possible to execute a custom script during the automatic defragmentation. Just click Settings > Preferences, open the Automatic defragmentation tab, select the Execute custom script option there and click OK. To adjust the script click Edit custom script or open the following file manually in a text editor: {installation folder}\tasks\auto-defrag-custom.cmd.
By default the program uses the following custom script:
@echo off
set UD_EX_FILTER=*system volume information*;*temp*;*tmp*;*recycle*
set UD_EX_FILTER=%UD_EX_FILTER%;*dllcache*;*ServicePackFiles*;*.log
set UD_EX_FILTER=%UD_EX_FILTER%;*Windows.old*
set ARCHIVE_PATTERNS=*.7z;*.7z.*;*.arj;*.bkf;*.bz2;*.bzip2;*.cab;*.cpio;*.deb
set ARCHIVE_PATTERNS=%ARCHIVE_PATTERNS%;*.dmg;*.gz;*.gzip;*.lha;*.lzh;*.lzma
set ARCHIVE_PATTERNS=%ARCHIVE_PATTERNS%;*.rar;*.rpm;*.swm;*.tar;*.taz;*.tbz
set ARCHIVE_PATTERNS=%ARCHIVE_PATTERNS%;*.tbz2;*.tgz;*.tpz;*.txz;*.xar;*.xz
set ARCHIVE_PATTERNS=%ARCHIVE_PATTERNS%;*.z;*.zip
set UD_EX_FILTER=%UD_EX_FILTER%;%ARCHIVE_PATTERNS%
set AUDIO_PATTERNS=*.aif;*.cda;*.flac;*.iff;*.kpl;*.m3u;*.m4a;*.mid
set AUDIO_PATTERNS=%AUDIO_PATTERNS%;*.mp3;*.mpa;*.ra;*.wav;*.wma
set VIDEO_PATTERNS=*.3g2;*.3gp;*.asf;*.asx;*.avi;*.flv;*.mov;*.mp4
set VIDEO_PATTERNS=%VIDEO_PATTERNS%;*.mpg;*.rm;*.srt;*.swf;*.vob;*.wmv
set UD_EX_FILTER=%UD_EX_FILTER%;%AUDIO_PATTERNS%;%VIDEO_PATTERNS%
set DISK_IMAGE_PATTERNS=*.fat;*.hdd;*.hfs;*.img;*.iso;*.ntfs;*.squashfs
set DISK_IMAGE_PATTERNS=%DISK_IMAGE_PATTERNS%;*.vdi;*.vhd;*.vmdk;*.wim
set UD_EX_FILTER=%UD_EX_FILTER%;%DISK_IMAGE_PATTERNS%
set UD_FRAGMENT_SIZE_THRESHOLD=20MB
set UD_LOG_FILE_PATH=%UD_INSTALL_DIR%\logs\autodefrag-system.log
udefrag --wait %SystemDrive%
set UD_LOG_FILE_PATH=%UD_INSTALL_DIR%\logs\autodefrag-fixed.log
set UD_FRAGMENTS_THRESHOLD=20
udefrag --wait --all-fixed