Computing.Net > Forums > Disk Operating System > Batch for processing all files in a Dir.

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch for processing all files in a Dir.

Reply to Message Icon

Name: Karl
Date: July 16, 2002 at 07:16:12 Pacific
Comment:

I need to have the following batch file run the OSQL statement against every .SQL file in the current directory

osql -U %USER_NAME% -P %PASSWORD% -S localhost -d %DATABASE% -i aaa.sql -o result.txt



Sponsored Link
Ads by Google

Response Number 1
Name: Secret_Doom
Date: July 16, 2002 at 11:45:49 Pacific
Reply:

All in the same line:

FOR %%? IN (*.sql) DO osql -U %USER_NAME% -P %PASSWORD% -S localhost -d %DATABASE% -i %%? -o result.txt

If you'll type this on the command prompt, not on a batch file, use '%?' instead of '%%?'.

-- Leonardo Pignataro - Secret_Doom --

secret_doom@hotmail.com
www.batch.hpg.com.br


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: Batch for processing all files in a Dir.

batch: iterating through all files in a dir www.computing.net/answers/dos/batch-iterating-through-all-files-in-a-dir/4969.html

How can I rename all files in a directory ? www.computing.net/answers/dos/how-can-i-rename-all-files-in-a-directory-/2201.html

moving in-use files www.computing.net/answers/dos/moving-inuse-files/5634.html