Export the file name list in the folder

Source: Internet
Author: User
Tags sorted by name

Batch save the file names of a folder to a text document, and use the system's built-in DOS to complete this task.


Procedure:

1. Enter the Command Prompt window

2. Enter drive D:

3. Enter the command DIR/S/on/B> D:/abc.txt

 

Command details:

Dir: list file tables.

/S is used to list all the files in the subdirectory in the current directory. The file size and modification date are displayed.

/On is used to specify that the files in the folder are sorted by name.

/B is used to generate a "pure" file name list, without showing the file size and modification date.

> Is used to specify the location where the command line output results are stored.

D:/abc.txt: Save the name of the file to the abc.txt file.

The PS:> character can also be replaced by>.

If the hosts file name .txt does not exist, >>create a new file;

If the hosts file name .txt already exists,> append the content to the file,> overwrite the original content.

  

How to export the file directory tree in Windows


Use the Tree Command in MS-dos:

1. Enter "cmd" in "run" of windows to enter the Command Prompt window (similar to the DOS Interface)

2. Enter D: To enter the drive for listing the Directory

3. Enter the folder name to enter the folder for listing the directory.

4. Tree/F> file name (for example, daochu.txt)

5.search for the output file daochu.txt in drive C, which is the desired file directory tree.

Supplement:

Tree/f/A> file name (use ASCII to export, you can achieve tree)

Tree /? (View help)

The format of the Tree Command is tree [Drive] [path] [/F] [/A].

/F: display the name of the file in each folder

/A uses ASCII characters instead of extended characters

You can click "tree/?" In the command line window /?" View help.

Format: Tree [drive letter:] [f] [> PRN]

When the/F parameter is used, all directories and all files under the directory are displayed. If this parameter is omitted, only directories are displayed, but files under the directory are not displayed;

When the> PRN parameter is selected, the listed directory and the file name in the directory are printed and output.

Example: tree/F> tree.txt


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.