I am trying to create a file with a list of directories that have a specific file name.
Let's say I'm trying to find directories that have a file named *.joe . At first I tried just dir /ad *.joe > dir_list.txt , but it looks for the directory names for *.joe , so there is no need to go.
Then I came to the conclusion that the for loop was probably the best choice. I started with
for /d /r %a in ('dir *.joe /b') do @echo %a >> dir_list.txt
and it looks like he did not execute the dir command. I added "usebackq", but it seems to work only for extending the / F command.
Ideas?
source share