To defragment files locked most of the time UltraDefrag can be launched inside of the Windows boot process. Being executed there UltraDefrag can defragment almost everything including paging and hibernation files.
To enable the boot time defragmenter click Settings > Boot time scan > Enable in UltraDefrag GUI. To configure it click the Script submenu or edit the following file manually: %SystemRoot%\system32\ud-boot-time.cmd.
The following command line tools can be used as well to control it: boot-on, boot-off and boot-config.
Being enabled the boot time defragmenter will run at every boot. However, you may skip its execution, just press any key when the appropriate prompt will be shown on the screen. To stop any disk operations later hit Pause/Break.
Hit Escape at any time to drop into an interactive console. It will show the following prompt on the screen and wait for your input:
Interactive mode: Type 'help' to list available commands. #
The same interactive console will be shown on the screen after the boot time script execution if the exit command is missing there.
000000C0: 0a 00 3b 00 20 00 46 00 | ; F 000000C8: 72 00 61 00 67 00 6d 00 | r a g m 000000D0: 65 00 6e 00 74 00 65 00 | e n t e
All commands displaying long lists (help, hexview, history, man, set, type) are splitting them into pages in the interactive mode.
Environment variables can be used the same way as in Windows batch files.
Two special variables are supported: DATE for the current date in the format YYYY-MM-DD and TIME for the current time in the format HH-MM:
2012-02-14 12-48
Encrypted disks cannot be defragmented at boot time because the local security service is inactive on early stages of Windows boot.
UltraDefrag terminates immediately in Windows safe mode because it cannot display text on the screen there.
By default the program defragments the Windows folder, registry hives, paging and hibernation files using the following script:
The next script utilizes special environment variables mentioned above:
◄ Console Interface | Scheduled Defragmentation ▶ |