execute commands from a list

November 30, 2009 at 14:45:13
Specs: Windows 2003
Hi guys:
i'have a folder with subfolders named from 1 to n+1
any folder has an .sql file inside.
I need to create a list of all sql files found in all subfolders, and then import them into sql database with sqlcmd.

i've tryed for command but without positive results.

any help well be apreciated.


See More: execute commands from a list

Report •

November 30, 2009 at 22:58:57
@echo off > newfile & setLocal enableDELAYedexpansion

pushd x:\topfolder

for /f "tokens=* delims= " %%a in ('dir/b/s/a-d *.sql') do (
>> newfile echo %%a
copy newfile con > nul

Helping others achieve escape felicity


Report •
Related Solutions

Ask Question