ultradefrag.sourceforge.net
The UltraDefrag Handbook

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 an ability to defragment any system files. Including page file, registry hives, hiberfil.sys file, another files locked by system or applications. Native UltraDefrag runs before any file locking, therefore it can process them as an ordinary files. View screenshots...

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

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

The only restriction on boot time scans is that you may not scan encrypted volumes. This is because lsass.exe, the component of the operating system that reads encrypted volumes, is loaded after the native executable runs.

To enable the boot time defragmenter open the UltraDefrag Configuration dialog and check the Enable box in the Boot time scan section. The boot time defragmenter can also be enabled by typing the boot-on in command prompt. To disable them the boot-off command may be used.

The boot time defragmenter cannot be used in Windows Safe Mode, because it cannot display text on the screen in this mode. UltraDefrag checks for boot options and returns immediately if Safe Mode flag has been found.

Boot time script

The boot time script consists of the disk defragmentation commands, ancillary commands and comments (with a semicolon (;) or # characters in the beginning). Its location is %windir%\system32\ud-boot-time.cmd. To edit this file type in command prompt boot-config or simply click the Script button in UltraDefrag Configuration dialog.

The following commands are accepted:

@echo on
Show commands on the screen. This is the default behaviour.
@echo off
Disable showing commands on the screen.
set
Set an environment variable. This is a native equivalent of the appropriate Windows command.
udefrag
This is a 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.
pause
Pause the script execution for the specified time interval (in milliseconds). For example, the command pause 1000 will pause execution for one second.
shutdown
Halt the computer.
reboot
Reboot the computer.
exit
Break the boot time program execution.
boot-on
Turn on the boot time defragmentation to be executed at every boot. Unfortunately, this command fails when shutdown or reboot commands are executed after it.
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. Unfortunately, this command fails when shutdown or reboot commands are executed after it.

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

Boot time script examples

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

 udefrag c:

 exit

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

Interactive mode

When the exit command is missing in the boot time script UltraDefrag runs in interactive mode after the last script command execution. In this case UltraDefrag displays the following command prompt and waits for the user input:

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

#

Currently there are just few simple commands supported in this mode. To show a full list of commands type help. To continue the Windows boot process type exit.

Generated on 29 May 2010 for UltraDefrag Handbook by Doxygen 1.6.2