啟動時介面命令

最後更新日期: 2026年1月16日

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 啟動進程。除非您需要使用互動式啟動控制台,否則最好將此命令放在啟動腳本的末尾。

幫助

此命令顯示所有可用命令的清單。.

六邊形視圖

此命令以十六進位檢視器佈局顯示檔案:

# hexview %SystemRoot%\system32\my-boot-time-script.cmd

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 命令在啟動時顯示長文本,甚至閱讀書籍🙂

# type c:\books\the-sign-of-the-four-chapter-3.txt

                      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

分享此頁面:
回到頂部 英語