XP Command Line: FOR ... IN ... DO

D

David Smith

I need to run a command line program that does not recognize *.* or
indeed *.[extension]. I have about 110 files to do, all with the same
parameters in the program.

I thought I knew how to do this with FOR ... IN ... DO, but I must have
done something wrong. My batchfile simply processes one file and then quits.

Assuming that I put all the target files (the files I want the command
line program to work on) into a separate directory, how do I construct a
batchfile to process all the files in the directory with the same
parameters? I think FOR ... IN ... DO will do it, but I need a refresher
on the syntax.

Any assistance much appreciated.

XP Home SP2
 
P

Pegasus \(MVP\)

David Smith said:
I need to run a command line program that does not recognize *.* or
indeed *.[extension]. I have about 110 files to do, all with the same
parameters in the program.

I thought I knew how to do this with FOR ... IN ... DO, but I must have
done something wrong. My batchfile simply processes one file and then quits.

Assuming that I put all the target files (the files I want the command
line program to work on) into a separate directory, how do I construct a
batchfile to process all the files in the directory with the same
parameters? I think FOR ... IN ... DO will do it, but I need a refresher
on the syntax.

Any assistance much appreciated.

XP Home SP2

It would be helpful if you showed us your batch file. In the
absence of any of your code, the lines below are pure
guesswork.

@echo off
for %%a in (*.*) do call :Sub %%a
goto :eof

:Sub
echo File name=%*
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top