Quantcast
Channel: Active questions tagged windows - Super User
Viewing all articles
Browse latest Browse all 9764

How to echo a txt file with list of file names in each folder

$
0
0

Let's say I have folder A and Folder B. Folder A has files A1 and A2. Folder B has files B1 and B2.

I want to create a text file in each folder that list the files in that folder. So create fileA.txt in folder A that list filenames A1 and A2 and same for B

Tried the following but didn't work

for /d %%g in ("*") do (    for /r %%y in ("*.mp4") do (        echo file '%%y'    ) > ./%%g/mylist.txt) 

Any help is appreciated


Viewing all articles
Browse latest Browse all 9764

Trending Articles