I have a folder "C:/files" it will have say 10 files in it how would I write the files name to a text file called files.txt. I need it so the names are all in septate lines so it will look something like this.

file1
file2
file3
ect

Thanks if any one can help.

有帮助吗?

解决方案

Under the folder (cd into it, or simple in the folder, SHIFT+Right click and select Open command window here), you can run the following dos command:

Dir /b *.* > list.txt

P.S. if you need the full path of each file, you can add extra /s option:

Dir /s /b *.* > list.txt
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top