Boot time defragmentation
Prev
Next

Chapter 5. Boot time defragmentation

Table of Contents

Overview
Boot time script
Supported commands
Interactive mode
Examples

Overview

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.

Boot time defragmenter

Unfortunately we cannot provide 64-bit native binaries of the boot time defragmenter. Therefore currently it cannot be used on 64-bit versions of Windows. In future this problem will be resolved, of course.

If the boot time defragmenter is enabled, you will see such picture at every reboot. Note that you will have a chance to exit safely without a driver loading, 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.

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 UltraDefrag GUI Configurator and check Enable box in Boot time scan section. The boot time defragmenter can also be enabled by boot-on command typed in the command line. To disable them use the boot-off command.

Boot time script

To edit the boot time script (contained in %windir%\system32\ud-boot-time.cmd file) type in command prompt boot-config or click Script button in UltraDefrag GUI Configurator.

The script contains defragmentation related commands and comments. To understand better commands used here, read please carefully the console interface section of this document.

The strings with a semicolon (;) or # characters in the beginning are comments.

Supported commands

The boot time script may contain the following commands.

@echo onShow commands on the screen. This is the default behaviour.
@echo offDisable showing commands on the screen.
set Set specified environment variable. The usage is the same as described in console application section of this document.
udefrag This command has the same options as the console interface.
pausePause the script execution for the specified interval (in milliseconds). P.a. the command pause 1000 will pause execution for one second.
shutdownHalt the computer.
rebootReboot the computer.
exitBreak the boot time program execution.
boot-onEnables the boot time defragger. For execution at every boot. Sorry, this command actually fails when shutdown or reboot commands are executed after it.
boot-offDisables the boot time defragger. It will be never executed at next reboots. Until you will enable them manually through Configurator program or boot-on.cmd script. Sorry, this command actually fails when shutdown or reboot commands are executed after it.

Any other commands will be ignored. When the defragger encounters the wrong syntax it shows the appropriate message and continues the script execution.

Interactive mode

You can run the boot time defragmenter in interactive mode. Just comment the exit command in script to leave the program to be running after the last command execution.

In interactive mode program shows a prompt like this:

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

#

Currently there are just few simple commands supported in this mode. Of course, in future this mistake will be reclaimed :) To show list of supported commands type help. To continue the Windows Boot Process type exit.

Examples

The complete example, installed 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

Note: If there is no exit command specified, the program will run in interactive mode after the last script command execution.

Hack: If you are using Windows 98 operating system but you wish to use the Ultra Defragmenter to optimize your drives from time to time than you have now one cool solution for that. Install Windows XP as a second operating system, install UltraDefrag on them and enable the boot time defragmenter. Insert the reboot command in the boot time script and enjoy! You can simply boot Windows XP, it will defrag anything and automatically reboot the computer at the end.

Prev
Next
Home


ultradefrag.sourceforge.net