sql - Batch file "For /f" loops each folder twice and listing files twice -


this loop loops through files twice. why so? how can modify each .sql file listed once.

for /f %%g in ('dir /s /b "%scriptspath%" *.sql') (     echo "%%g" )  

the dir command getting confused "*.sql" separate argument. try instead. code assumes scriptspath variable end in backslash.

for /f %%g in ('dir /s /b "%scriptspath%*.sql"') (     echo "%%g" )  

Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

c++ - Correct method for redrawing a layered window -

java.util.scanner - How to read and add only numbers to array from a text file -