I am looking for a way to list some files with a specific extension, in a specific subfolder, that is:
Directorios:
a>a1>a2
b>b1>b2
Siendo b Carpeta
|
|b1 Sub Carpeta
- |
|
|b2 Sub
-
I want to list all the *.txt that are in the folder that contains "1".
I am doing it with:
for /R C:\ /D %%v in (*1*) do (
echo %%v
)
So I get the directories, and so I look for the files
for /R "C:\" %%f in (*txt) do (
echo "%%f"
)
Of course the last one looks for the *txt of all the directories.
I have tried to do:
for /R C:\ /D %%v in (*1*) do (
for /R %%v %%f in (*txt) do (
echo "%%f"
)
)
What I was trying to do was pass the path of %%v to be the file search.
I suppose there will be some expression to be able to do this.
Try this: