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

  • Thread starter Thread starter David Smith
  • Start date Start date
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
 
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=%*
 
Back
Top