MrPatterns
MrPatterns

Reputation: 4434

Using a script how do I create a text file that contains all of the filenames in a directory C:\sample\?

Using a script how do I create a text file that contains all of the filenames in a directory C:\sample\?

I've seen similar topics on stackoverflow but they are in Perl or VB6...is it possible to this in a batch file in windows 7?

Upvotes: 0

Views: 1596

Answers (2)

Joel Lucsy
Joel Lucsy

Reputation: 8706

A simple command will do:

dir /b c:\sample > out.txt

Upvotes: 2

Michael Burr
Michael Burr

Reputation: 340198

dir /s/b c:\sample\*.* > somefile.txt might be what you're looking for.

Upvotes: 1

Related Questions