SyntaxFix
Write A Post
Hire A Developer
Questions
dir /s/d/a:-d "folderpath*.*" > file.txt
And, lose the /s if you do not need files from subfolders