Wednesday, 15 July 2015

batch file - How to recursively loop through a directory on a specific filetype? -



batch file - How to recursively loop through a directory on a specific filetype? -

i can't find specific mention of issue, though seems mutual problem.

i'm trying loop through batch files in directory, regardless of how deep.

here have:

for /f "tokens=* delims=" %%a in ('dir %dir% /s /b *.bat') ( if not exist %%a\* echo %%a )

where dir set beforehand. i'm echoing files.

clearly wrong outputs firstly files, batch files.

seems need somehow merge *.bat specifier , %dir% variable i'm not sure how this.

for /r %dir% %%a in (*.bat) ( ...

batch-file for-loop file-type

No comments:

Post a Comment