How can I iterate over each file in a directory using a for
loop?
And how could I tell if a certain entry is a directory or if it's just a file?
batch-filecmdfor-loopwindows
How can I iterate over each file in a directory using a for
loop?
And how could I tell if a certain entry is a directory or if it's just a file?
Best Answer
This lists all the files (and only the files) in the current directory:
Also if you run that command in a batch file you need to double the % signs.
(thanks @agnul)