Win7 原生右鍵選單無「列印目錄」功能,透過建立批次檔 Printdir.bat 並放入 SendTo 選單,即可在任意資料夾右鍵 → 傳送給 → 列印目錄,自動以記事本開啟目錄清單並送列印。
Printdir.bat:@echo off
dir %1 /-p /o:gn > "%temp%\Listing"
start /w notepad /p "%temp%\Listing"
del "%temp%\Listing"
exit
Printdir.bat 複製至 C:\Windows (需管理員權限)。shell:sendto 開啟 SendTo 資料夾。%windir%\Printdir.bat,下一步。
dir %1 /-p /o:gn:列出目標資料夾 (%1) 內容,依群組/名稱排序,不分頁。start /w notepad /p:以列印模式開啟記事本,/w 等待列印完成再關閉。%temp%\Listing 列印後自動刪除。dir 參數可自訂輸出格式 (如 /s 遞迴子目錄、/q 顯示擁有者)。tree 指令可輸出樹狀結構。