启动时接口命令
最后更新日期:
UltraDefrag 的启动时接口支持多种命令。.
笔记
显示长列表的命令( ,,,,, )会将输出分成多个页面,并提示按任意键在交互模式下继续切换。helphexviewhistorymansettype
添加键盘初始化延迟
此命令会在启动时添加键盘初始化延迟。如果启动时界面无法检测到您的键盘,或者由于键盘驱动程序存在缺陷导致检测时间过长,请将其添加到主启动脚本中。.
启动
此命令启用启动时碎片整理功能,以便后续系统重启。.
启动关闭
此命令会禁用后续系统重启时的启动时磁盘碎片整理功能。建议将此命令放在启动脚本的开头,以确保即使在碎片整理过程中出现问题,Windows 仍然可以启动。.
称呼
此命令类似于等效的 Windows 命令。它会执行一个批处理脚本。如果未指定任何脚本,则该命令会执行主启动时脚本(%SystemRoot%\system32\ud-boot-time.cmd):
1 2 | :: execute the C:\WINDOWS\system32\my-boot-time-script.cmd script call C:\WINDOWS\system32\my-boot-time-script.cmd |
回声
此命令类似于 Windows 中的相应命令。它可以显示一条消息或一个空行,设置是否在屏幕上显示命令,或者显示当前设置:
1 2 3 4 5 6 7 8 9 10 | :: do not display commands on the screen @echo off :: show the current status of echo echo :: display a couple of messages with an empty line in between echo Hello! echo. echo Greetings from Georgia! |
出口
此命令类似于 Windows 中的相应命令。它会终止脚本执行并将控制权交还给 Windows 启动进程。除非您需要使用交互式启动控制台,否则最好将此命令放在启动脚本的末尾。
帮助
此命令显示所有可用命令的列表。.
六边形视图
此命令以十六进制查看器布局显示文件:
0000000000000000: ff fe 40 00 65 00 63 00 | ӱϸ@ e c
0000000000000008: 68 00 6f 00 20 00 6f 00 | h o o
0000000000000010: 66 00 66 00 0d 00 0a 00 | f f
0000000000000018: 62 00 6f 00 6f 00 74 00 | b o o t
0000000000000020: 2d 00 6f 00 66 00 66 00 | - o f f
0000000000000028: 0d 00 0a 00 0d 00 0a 00 |
...
该命令有助于故障排除。例如,如果您将启动脚本保存为 UTF-16 以外的编码, UltraDefrag 将无法执行它。要检查脚本编码是否正确,您可以使用该 命令检查脚本的前两个字节。如果脚本编码正确,您将在脚本开头看到“ff fe” ,如上面的示例所示。hexviewhexview
历史
此命令显示所有手动输入的命令列表。要循环浏览这些命令,请使用键盘上的上下箭头键/光标键。.
男人
此命令显示手册页,如果调用时不带参数,则显示所有可用手册页的列表:
1 2 3 4 5 | :: list all the available manual pages man :: display the udefrag command manual man udefrag |
暂停
此命令会暂停脚本执行指定的毫秒数,或者显示消息 “按任意键继续…” ,如果没有指定持续时间,则会等待直到按下某个键:
1 2 3 4 5 | :: pause the script execution for one second pause 1000 :: pause the script execution till a key is pressed pause |
重启
此命令会重启计算机。.
放
此命令与相应的 Windows 命令类似。它可以设置、清除和列出环境变量:
1 2 3 4 5 6 7 8 9 10 11 | :: show all the environment variables set :: show all UltraDefrag specific environment variables set UD_ :: set the UD_IN_FILTER environment variable set UD_IN_FILTER=*windows* :: clear the UD_IN_FILTER environment variable set UD_IN_FILTER= |
关闭
此命令会关闭计算机。当您执行耗时较长的操作时,例如磁盘优化,此命令尤其有用:
1 2 3 4 5 6 | :: optimize the system disk udefrag -o %SystemDrive% :: shut the computer down when :: the disk optimization finishes shutdown |
类型
此命令类似于 Windows 中的相应命令。它会在屏幕上显示一个文件。如果未指定文件,则该命令会显示主启动脚本:
1 2 | :: display the custom boot time script type %SystemRoot%\system32\ud-boot-time-custom.cmd |
该命令的主要用途 type 是故障排除。例如,您可以使用它在交互式控制台中轻松显示启动脚本,以便检查语法错误。此外,您还可以使用该 type 命令在启动时显示长文本,甚至阅读书籍🙂
Arthur Conan Doyle
The Sign of the Four
Chapter III
In Quest of a Solution
It was half-past five before Holmes returned. He was bright, eager,
and in excellent spirits, a mood which in his case alternated with
fits of the blackest depression.
"There is no great mystery in this matter," he said, taking the cup
of tea which I had poured out for him. "The facts appear to admit of
only one explanation."
"What! You have solved it already?"
"Well, that would be too much to say. I have discovered a suggestive
fact, that is all. It is, however, very suggestive. The details are
Hit any key to display the next page, Esc or Break to abort...
udefrag
此命令是中 UltraDefrag 以下命令行开关 CLIudefrag命令的启动时等效命令。它支持: ,,,,,,,, 。-l-la-a-o-q--optimize-mft--all--all-fixed--deep
要处理单个文件和目录,请指定它们的完整路径,如果路径包含空格,请用双引号将其括起来:
1 | udefrag "C:\Documents and Settings\*" C:\WINDOWS\WindowsUpdate.log |