문제

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