Win7 原生不支援右鍵直接列印資料夾檔案清單。本文提供兩種方案:方法一 單次需求用 CMD dir 輸出文字檔列印;方法二 永久整合至右鍵「傳送到」選單,一鍵完成。
dir /b /o:gn > filelist.txt
/b 純檔名模式/o:gn 依名稱排序,資料夾優先> 重導向輸出至檔案filelist.txt → Ctrl+P 列印@echo off
dir %1 /b /o:gn > "%temp%\dirlist.txt"
notepad /p "%temp%\dirlist.txt"
del "%temp%\dirlist.txt"
exit
Printdir.bat,編碼選 ANSI (相容性最佳)C:\Windows\ (或 %SystemRoot%)shell:sendto 開啟 SendTo 資料夾%windir%\Printdir.bat →「下一步」| 參數 | 效果 |
|---|---|
/b | 僅顯示檔名 (無日期/大小/屬性) |
/s | 遞迴包含子資料夾檔案 |
/o:gn | 資料夾優先 (g),依名稱排序 (n) |
/o:d | 依日期排序 (最新在前) |
/o:s | 依大小排序 |
notepad /p | 直接喚起列印對話框 (無需開啟視窗) |
cm_PrintDir 指令方法一適合臨時需求零設定;方法二一次設定永久受用,整合至原生「傳送到」選單不侵入系統核心。批次檔邏輯簡單透明,可依需求調整 dir 參數與輸出格式,是 Win7 檔案管理實用小技巧典範。