set path="D:\Work,D:\workin,D:\files"
set files ="txt,html,xml"
How to search for files with an extension defined in files
in the directories defined in path
and write their names into a file?
Here is what I have tried already:
set "list=list.txt"
pause
pushd "%~dp0"
>"%list%" (
for /f "delims=" %%i in ('2^>nul dir /ad /b') do (
pushd "%%i"
for /f "delims=" %%j in ('2^>nul dir /a-d /b *.txt *.html') do (
echo %%j& >nul 2>&1 copy/y "%%j" ..
)
popd
)
)
popd