方法一
STEP 1
cd
、空格、然後 drag 目標 folder 至 CMD
cmd
cd <folderpath> |
STEP 2
隨意起名,以下例子把導出檔案命名為 output.txt
。
cmd
tree /a /f > ouput.txt |
生成的 txt 內容類似這樣
Code
C:. |
方法二
語法
cmd
tree /f > ouput.txt |
生成的 txt 內容類似這樣
Code
C:. |
Options meaning:
/a
Display the tree using standard ASCII characters./b
Display the full pathname of each directory, without any of the line-drawing characters./d
Display file and directory descriptions./f
Display files as well as directories./h
Display hidden as well as normal directories. If you combine/h
and/f
, hidden files are also displayed./t
Display the time and date for each directory. If you combine/t
and/f
, the time and date for each file will also be displayed./T:c
Creation date and time./T:w
Last modification (“write”) date and time (default).
/z
Display the size of each file./z
without a/f
will display the subdirectory tree sizes.
純列出,不樹狀
語法
bash
dir /s /b> ouput.txt |
生成的 txt 內容類似這樣
Code
C:\Users\helloword.docx |
純列出,不樹狀,只有檔案名
語法
bash
dir /b /a-d> ouput.txt |
生成的 txt 內容類似這樣
Code
helloword.docx |
References: https://jpsoft.com/help/tree.htm