ultradefrag.sourceforge.net
The UltraDefrag Handbook  5.0.0
Boot Time Defragmentation

UltraDefrag also includes a new mode that allows you to run it at boot time in a manner similar to chkdsk. This is known as a native application. It provides the ability to defragment any system file. Including page file, registry hives, hiberfil.sys file and any other files locked by the system or applications. Native UltraDefrag runs before any file locking, therefore it can process them as ordinary files. View screenshots...

If the boot time defragmenter is enabled, it will run at every boot. Note that you will have a chance to exit immediately, just press any key when the appropriate prompt is displayed. If no key is pressed during this delay, the boot time script will be executed.

You can always stop the volume analysis/defragmentation by pressing the Pause/Break key on the keyboard.

The following restrictions exist for the boot time scans:

  • You may not scan encrypted volumes. This is because lsass.exe, the component of the operating system that reads encrypted volumes, is still not loaded at a time of the native applications execution.
  • In Windows Safe Mode the program cannot display text on the boot screen. UltraDefrag checks for boot options and returns immediately, if the Safe Mode flag has been found.

The boot time defragmenter can be enabled/disabled either from the main GUI window or by typing boot-on/boot-off commands in the command prompt.

Boot Time Modes

The boot time defragmenter can be executed in two modes:

Boot time script

The boot time script consists of the disk defragmentation commands, ancillary commands and comments. It is located at %windir%\system32\ud-boot-time.cmd. To edit this file execute boot-config at the command prompt or simply click the Script button of the UltraDefrag Configuration dialog.

The boot time script simplifies also the use of UltraDefrag on computers running Windows 98. After installing Windows XP as a second operating system, UltraDefrag may be installed too. After adding the shutdown command to the boot time script you may simply boot the XP system (which requires much less resources at boot time!) and safely leave your computer. It will be shut down automatically after the job is completed.

To abort the script execution and enter the interactive mode immediately hit ESC at any time during boot time script processing.

Interactive mode

When the exit command is missing in the boot time script UltraDefrag runs in interactive mode after the last script command is executed. UltraDefrag displays the following command prompt and waits for the users input:

Interactive mode:
Type 'help' for list of supported commands.

#

All commands displaying long lists (help, hexview, history, man, set, type) are splitting them into pages in interactive mode.

Available Boot Time Commands

; or #
Lines starting with one of these characters are treated as comments.
@
Do not show the command line preceded by the at-sign on the screen. By default the command line is displayed on the screen.
boot-on
Turn on the boot time defragmentation to be executed at every boot.
boot-off
Turn off the boot time defragmentation. It prevents them from being executed at next reboots. Until you will enable them manually through UltraDefrag Configuration dialog or boot-on.cmd script.
call
Similar to the DOS command. Executes the specified script. If no script is specified, the default boot time script is executed.
echo
Similar to the DOS command. Display a message, empty line, enable/disable showing the command line on the screen or display the status of showing the command line.
exit
Similar to the DOS command. Break the boot time program execution and return the specified error code or zero.
help
Show a list of all available commands.
hexview

Display the contents of the specified file in a HEX viewer layout.

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

history
Show a list of all manually entered commands. To cycle through the commands use the up/down arrow/cursor keys.
man
List or display available manual pages.
pause
Pause the script execution for the specified time interval (in milliseconds, 2147483647 maximum) or till a key is pressed, if no duration is specified. For example, the command pause 1000 will pause execution for one second.
reboot
Reboot the computer.
set
Similar to the DOS command. List, set and clear environment variables. For further information about the supported variables consult the Console Interface page.
shutdown
Halt the computer.
type
Similar to the DOS command. Display the contents of a file, the default is the boot time script.
udefrag
This is the native equivalent of the UltraDefrag command line tool. The following keys are supported: -la, -l, -a, -o, --all, --all-fixed. Multiple drive letters on a single command line are allowed.
You can specify absolute paths to process single files or directories. Paths including spaces must be enclosed by double quotes ("). To specify multiple paths separate them by spaces.
Example: udefrag "C:\Documents and Settings" C:\WINDOWS\WindowsUpdate.log

When UltraDefrag encounters the wrong syntax it shows an appropriate message on the screen and continues the script execution.

For further information about the command switches and variables consult the Console Interface page.

Boot time script example

The following script is used by default:

 ;--------------------------------------------------------------------
 ;                UltraDefrag Boot Time Shell Script
 ;--------------------------------------------------------------------
 ; !!! NOTE: THIS FILE MUST BE SAVED IN UNICODE (UTF-16) ENCODING !!!
 ;--------------------------------------------------------------------

 set UD_IN_FILTER=windows;winnt;ntuser;pagefile;hiberfil
 set UD_EX_FILTER=temp;recycle;system volume information

 udefrag c:

 exit

Previous: Graphical Interface Next: File Fragmentation Reports