Windows generates directory structure tree method (tree)

step:

  1. Enter the folder where the directory tree needs to be generated, change the address bar to cmd, you will directly enter the DOS interface, and it is already in the current directory.
  2. Use the following command:
  • tree: Print the directory structure tree of the current directory in the current directory (not including all files in the directory).
  • tree /f: Print the directory structure tree of the current directory (including all files in the directory) in the current directory.
  • tree /f > list.txt, The directory structure is output to the list.txt file in the current directory.

Insert picture description here
Insert picture description here

problem:

Prompt 'tree' 不是内部或外部命令,也不是可运行的程序或批处理文件
Search for tree in the windows directory, and found no tree.exe, onlytree.com
Insert picture description here


solve:

Use the following command:

  • C:\Windows\System32\tree.com: Print the directory structure tree of the current directory in the current directory (not including all files in the directory).
  • C:\Windows\System32\tree.com /f: Print the directory structure tree of the current directory (including all files in the directory) in the current directory.
  • C:\Windows\System32\tree.com /f > list.txt, The directory structure is output to the list.txt file in the current directory.

Guess you like

Origin blog.csdn.net/p1279030826/article/details/113736354