cmd - Loop through certain files in batch -
i have directory contains .sql files like
file.xxx.v3.0.sql file.xxx.v3.0.sql file.xxx.v3.0.sql file.xxx.v3.0.sql
in .bat file how loop through files in directory start "file." , end in ".v3.0.sql"?
so far i've got
for /f %%b in ('dir /b /s "%apppath%\files\*.sql"') call :import %%b
forego for /f
route. there dragons (for unicode characters , spaces, – best not pick bad habits).
you can use plain old for
, can iterate on files fine:
for %%b in (%apppath%\files\file.*.v3.0.sql) ( call :import %%b )
Comments
Post a Comment