Get the App
SLTechnology News&Howtos  ›  Development  › 

How to implement batch dir.bat for generating structural trees in the current directory

Shulou Source: shulou.com Published: 2022-06-03 08:22:59 09月12日 Update

This article mainly introduces how to achieve the batch dir.bat of generating the structure tree in the current directory, which is very detailed and has a certain reference value. Interested friends must read it!

Dir.bat

The code is as follows:

@ rem this BAT file name must not be "tree.bat", otherwise the tree command will be effective. I don't know why.

@ rem may be because the system directory has "tree.com", the system will be confused.

@ rem uses "dir.bat" as the file name, but it's okay.

@ echo off

Rem generates a beautiful structure tree in the current directory

Tree / f > 1.TXT

Rem is like the DIR command, but each subordinate directory file is also listed

DIR / S > 2.txt

Rem succinctly lists the current directory files

DIR / d > 3.txt

The above is all the contents of the article "how to generate a batch dir.bat of a structural tree in the current directory". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Tags: Directory file tree construction generation content command file name article system beauty simplicity subordinate code value interest utility boy buddy more knowledge Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux Apple vpn MariaDB Microsoft