Generate a list of files using batch files


When batch files are used to generate a list of files, friends will encounter such situations: if you want to copy the names of all files in a folder, or list the names of all files in a list, if you copy them manually, it is not pleasant and easy to make mistakes.
Xiaobian shares a simple method here today. Self made batch command of bat automatically generates file list for one-time copying.


First into the file directory, create a. TXT format of pure document file.

Copy the following commands in this text document and save them.

Copy codeThe code is as follows:
@echo off
dir /b /on >list.txt

Change the suffix of this text document from. Txt to. Bat

Double click to execute the. Bat file

A list document file of list.txt will be generated automatically

Double click to open it. Isn’t it the name of the file in the folder?