嘗試 Windows 10 上的新硬碟容量分析工具“磁碟使用情況”

嘗試 Windows 10 上的新硬碟容量分析工具“磁碟使用情況”

微軟正在創建一個內建的磁碟使用命令列實用程序,用於報告資料夾使用了多少磁碟空間。

隨著時間的推移,儲存空間不足並且不知道哪些程式或檔案正在佔用硬碟空間是很常見的。以前,用戶需要下載 TreeSize 等免費工具來列出使用空間最多的資料夾。

在使用上週發布的新 Windows 10 Insider 版本 20277 和 21277 進行測試時,一些人發現微軟已經悄悄推出了一個新的磁碟使用實用程式。該實用程式可以掃描整個磁碟機或指定資料夾並報告每個資料夾的使用量。

磁碟使用情況,Windows 10 上新的硬碟容量分析工具

磁碟使用情況位於C:\Windows\System32\diskusage.exe ,輸入diskusage /?時會顯示使用說明, 如下圖所示。

嘗試 Windows 10 上的新硬碟容量分析工具“磁碟使用情況”

磁碟使用說明

該程式處於開發的早期階段,某些功能無法如預期運作,且使用手冊中存在一些拼字錯誤。

對於有興趣的人,以下是完整的使用說明:

DiskUsage - Disk Usage

Description: Summarize disk usage recursively for the given directory.
Usage      : diskusage [Options] [Directory]
Options    :
    /a, /systemAndReserve    displays size for system files and reserved space
    /c, /csv                 displays in csv format
    /d, /maxDepth=N          displays directory information only if it is N or
                             fewer levels below command line argument
    /e, /minFileSize=SIZE    displays directory information only if its FileSize
                             is greater or equal than SIZE
    /f, /minSizeOnDisk=SIZE  displays directory information only if its SizeOnDisk
                             is greater or equal than SIZE
    /g, /displayFlag=FLAG    specifies the flags value to determin which column(s) to display
                             column          value    description
                             SizeOnDisk      0x001    the on disk size
                             FileSize        0x002    the end of file size
                             SizePerDir      0x004    sum of SizeOnDisk for top level child
                             Files           0x008    number of child files
                             ChildDirs       0x010    number of child directories
                             FilesPerDir     0x020    number of top level child files
                             DirsPerDir      0x040    number of top level child directories
                             CreationTime    0x080    file creation timestamp
                             LastAccessTime  0x100    file last access timestamp
                             LastWriteTime   0x200    file last write timestamp
                             Attributes      0x400    file attributes
    /h, /humanReadable       displays size in human readable format
    /i, /iniFile=FILE        takes all the parameters from an INI file.
                             NOTE: SCENARIO name must be speificed via /j (/scenario)
    /j, /secnario=SCENARIO   specifies the scenario name for the INI file
    /l, /allLinks            count all hardlinks separately (By default, files with multiple
                             hardlinks are counted only once towards the first link name)
    /m, /multipleName        count only files with more than one link names
    /n, /nameFilter=FILTER   count only files whose name matches the name filter
    /p, /preferredPath=PATH  count files with multiple link names towards the first link that's
                             under PATH if it exists
                             NOTE: This options must not be specified togerther
                             with /l (/allLinks)
    /q, /virtual             recurse into virtual directories
    /r, /skipReparse         skip recursing into reparse directories
    /s, /skipResurse         skip recursing into child directories when calculating sizes
    /t, /TopDirectory=N      displays Top N directories by SizeOnDisk in descending order
    /u, /TopFile=N           displays Top N files by SizeOnDisk in descending order
    /v, /verbose             displays verbose error information
    /x, /clearDefault        do not display the default selected columns

測試新的磁碟使用實用程式

微軟的新磁碟使用工具正處於開發的早期階段,因此它非常基礎。讓我們看看它是如何工作的。

預設情況下,執行「磁碟使用情況」時,它會以位元組為單位報告檔案和資料夾容量,這不如以 MB、GB 等單位顯示容量有用。幸運的是,Microsoft 包含了參數 .a / h來顯示人類可讀的容量。在下面的範例中使用。

在虛擬機器上執行此測試時,例如沒有安裝大量資料或大型程序,因此本文使用C:\Windows資料夾進行測試。

由於該工具需要管理權限,因此在使用diskusage.exe之前,您必須先在Windows 10上以管理員權限開啟命令提示符,否則會顯示錯誤。

例如,若要查看 C:\Windows 中大於 1GB 的資料夾,請執行下列命令:

diskusage /minFileSize=1073741824 /h c:\windows

如下所示,磁碟使用情況列出了所有大於 1GB 的資料夾,包括 C:\Windows 資料夾。

嘗試 Windows 10 上的新硬碟容量分析工具“磁碟使用情況”

C:\Windows 中大於 1GB 的資料夾

磁碟使用情況還包括列出磁碟機或指定資料夾中前 N 個(數量)的資料夾的功能。為此,請使用命令/t=[number],如下所示:

diskusage /t=5 /h c:\windows

不幸的是,該命令的輸出並不符合預期。如下所示,它顯示了 5 個資料夾的排序列表,但根據前面的命令,它們不是範例所期望的資料夾。

嘗試 Windows 10 上的新硬碟容量分析工具“磁碟使用情況”

C:\Windows下容量最大的5個資料夾

文章猜測上述指令顯示最大的資料夾,而不考慮其子資料夾中的檔案。

磁碟使用情況還包括其他功能,例如使用/u選項列出最大的文件,如下列命令所示:

diskusage /u=5 /h c:\windows

如下所示,磁碟使用情況顯示 5 個最大的文件,而不是顯示 5 個最大的資料夾。

嘗試 Windows 10 上的新硬碟容量分析工具“磁碟使用情況”

C:\Windows下容量最大的5個文件

磁碟使用情況中包含的其他功能包括建立包含要自動使用的選項的設定檔、輸出自訂以及忽略不同類型資料夾的功能。

如前所述,磁碟使用仍處於早期階段,目前還沒有關於何時正式出現的資訊。現在您可以透過安裝最新的 Windows 10 Insider 版本來測試它。


如何測試 Windows 10 網路攝影機

如何測試 Windows 10 網路攝影機

檢查網路攝影機在 Windows 電腦上是否正常運作既快速又簡單。以下是幫助您檢查相機的步驟。

如何在 Windows 10 中測試麥克風

如何在 Windows 10 中測試麥克風

也許您插入了優質耳機,但由於某種原因,Windows 筆記型電腦不斷嘗試使用其糟糕的內建麥克風進行錄音。以下的文章將指導您如何測試Windows 10麥克風。

如何從右鍵選單中刪除 Scan with Malwarebytes

如何從右鍵選單中刪除 Scan with Malwarebytes

如果您不再需要它,可以從右鍵單擊上下文功能表中刪除「使用 Malwarebytes 掃描」選項。就是這樣。

了解邊界網關協定 (BGP)

了解邊界網關協定 (BGP)

邊界網關協定 (BGP) 用於交換 Internet 的路由資訊,是 ISP(不同的 AS)之間使用的協定。

如何建立您自己的 Windows 登錄 hack 文件

如何建立您自己的 Windows 登錄 hack 文件

在閱讀提示時,您會看到人們經常使用註冊表黑客文件來自訂和調整 Windows 計算機,並想知道如何創建它。本文將引導您完成建立自己的註冊表駭客檔案的基本步驟。

如何在 Windows 10 中啟用自動登錄備份

如何在 Windows 10 中啟用自動登錄備份

微軟曾經有自動備份登錄的功能,但這個功能在 Windows 10 中已經悄悄停用。在本文中,Quantrimang.com 將引導您完成自動備份登錄到資料夾 RegBack (Windows\System32\config) 的步驟。 \RegBack) 在Windows 10 上。

如何在 Windows PC 上撤銷操作

如何在 Windows PC 上撤銷操作

使用計算機時,犯錯是完全正常的。

如果 Windows 10/11 上乙太網路連線不斷斷線怎麼辦?

如果 Windows 10/11 上乙太網路連線不斷斷線怎麼辦?

有時,您的乙太網路連接可能會在 Windows 10 或 11 電腦上無故斷開連接,從而讓您感到沮喪。

電腦關機後可以遠端存取嗎?

電腦關機後可以遠端存取嗎?

即使您的裝置已關閉,其他人也可以存取您的裝置嗎?可怕的答案是肯定的。

2024 年全球 10 大廉價 SSL 憑證供應商

2024 年全球 10 大廉價 SSL 憑證供應商

SSL 憑證有助於確保敏感客戶資訊的安全,並為您的線上業務建立安全的環境。