1.

Solve : Batch file to use list of files and perform an action for each of the files?

Answer»

Hello.  I have to run a COMMAND line to process one file at a time in Irfanview.  My command line looks like this:

Code: [Select]"c:\program files (x86)\irfanview\i_view32.exe" c:\tif\430251.tif /extract=(c:\tiffsplit, tif)
"c:\program files (x86)\irfanview\i_view32.exe" c:\tif\430252.tif /extract=(c:\tiffsplit, tif)
"c:\program files (x86)\irfanview\i_view32.exe" c:\tif\430253.tif /extract=(c:\tiffsplit, tif)
"c:\program files (x86)\irfanview\i_view32.exe" c:\tif\430254.tif /extract=(c:\tiffsplit, tif)
"c:\program files (x86)\irfanview\i_view32.exe" c:\tif\430255.tif /extract=(c:\tiffsplit, tif)
"c:\program files (x86)\irfanview\i_view32.exe" c:\tif\430256.tif /extract=(c:\tiffsplit, tif)

I have to create this batch file in the following steps:
1.  run:  dir /b c:\temp > list.txt       (to create a list of files)
2.  Copy/Paste the list into Excel
3.  Concatenate a command line for each file in Excel.
4.  Copy concatenated lines into a batch file.

Is there a way I can skip all of those steps and do something like:
forfiles /p c:\temp /m *.tif  IRFANVIEWSCRIPT

Thanks!

Brian
Code: [Select]echo off
for %%G in (c:\tif\*.tif) do "c:\program files (x86)\irfanview\i_view32.exe" "%%~G" /extract=(c:\tiffsplit, tif) Worked GREAT!  Thanks!



Discussion

No Comment Found