Batch File; List files in directory, only filenames?

前端 未结 8 1365
我在风中等你
我在风中等你 2021-01-29 22:07

This is probably a very simple question, but I\'m having trouble with it. Basically, I am trying to write a Batch File and I need it to list all the files in a certain directory

8条回答
  •  囚心锁ツ
    2021-01-29 22:20

    1.Open notepad

    2.Create new file

    3.type bellow line

    dir /b > fileslist.txt
    

    4.Save "list.bat"

    Thats it. now you can copy & paste this "list.bat" file any of your folder location and double click it, it will create a "fileslist.txt" along with that directory folder and file name list.

    Sample Output:

    Note: If you want create file name list along with sub folder, then you can create batch file with bellow code.

    dir /b /s > fileslist.txt
    

提交回复
热议问题