启动时接口概述
最后更新日期:
UltraDefrag 包含一个特殊的启动时接口,其目的是在系统重启期间,在 Windows 和应用程序完全加载并锁定文件之前,对锁定的文件执行碎片整理和优化。.
笔记
请查看以下文章,了解如何使用 UltraDefrag 的启动时界面执行典型的磁盘碎片整理任务:
UltraDefrag 启动时界面的另一个有趣功能是,您可以为其编写自定义脚本,甚至可以交互式地使用它。请按照以下步骤指南操作:
-
启动 UltraDefrag 并单击 启动时处理 > 编辑自定义脚本.

或者,您也可以在您喜欢的文本编辑器中手动打开以下文件:
%SystemRoot%\system32\ud-boot-time-custom.cmd。 -
将以下内容粘贴到脚本中,然后保存:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19@echo off
::
:: A custom boot time script example.
::
:: This script optimizes the master
:: file table (MFT) on the system disk.
::
:: Please note, you have to save this script
:: in Unicode (UTF-16 / UCS-2 LE BOM) encoding.
::
:: turn the boot time defragmentation off for subsequent boots
boot-off
:: optimize the master file table on the system disk
udefrag --optimize-mft %SystemDrive%
:: pass control back to the Windows boot process
exit -
点击 启动时处理 > 执行自定义脚本.

-
点击 是的 立即执行启动时脚本或 稍后重启 在下次系统重启时执行。.

-
系统重启期间, UltraDefrag 将启动其启动时界面并执行自定义脚本。.
UltraDefrag 15.0.0 boot time interface.
Copyright (c) 2018-2026 Green Gate Systems, LLC.
UltraDefrag comes with ABSOLUTELY NO WARRANTY.
If something is wrong, hit F8 on startup
and select 'Last Known Good Configuration'
or execute 'CHKDSK {Drive:} /R /F'.
Keyboard device found: \Device\KeyboardClass0.
Press any key to exit .....
Preparing to optimize MFT on disk C: ...
Use Pause/Break key to abort the process early.
Optimization: 100.00%, fragmented/total=0/1009398
Drive information:
Total space = 118.12 GB
Free space = 15.77 GB
Total number of files = 1009398
Number of fragmented files = 0
Fragments per file = 1.00
Fragmentation = 0.00%
Good bye... -
差不多就是这样了!现在是时候学习可用的 命令 和 环境变量,再看看一些 启动脚本示例 ,最后,编写你自己的自定义脚本了😉
交互式控制台
如果省略 exit 脚本中的命令, UltraDefrag 将在脚本执行后显示一个交互式启动控制台:
Interactive mode:
Type 'help' to list available commands.
#
Type 'help' to list available commands.
#
交互式控制台对于学习脚本语法和命令非常有用,因为您可以逐个输入命令,并在编写自己的自定义启动脚本之前检查它们的工作原理。.
此外,您还可以在脚本执行期间随时按下键盘上的Esc键进入控制台。
脚本语法
UltraDefrag 使用类似批处理的语法来编写自定义启动脚本。以 `\ :: ` 或 ; `\` # 是注释。所有其他行都以命令名称开头,后跟可选参数。如果命令 @ 名称前有 `\` 符号,命令行解释器在执行命令前不会显示该命令。