Question : Use DOS Batch File to Expand Wildcard into Filenames

Greetings. I have a program that takes a single filename as a parameter (i.e. no wildcards). I'd like to create a batch file as a "wrapper" for this program so that I may pass a wildcard to the batch file and have the it extract each individual filename that fits the wildcard and pass them one by one to the program in a loop.

My batch script writing is pretty rusty, so I would appreciate any help. If you can give me an example that I can put to use or the entire script, that would be very helpful to me, hence the 500 points.

If you need more information, just let me know.,

Thanks!

Answer : Use DOS Batch File to Expand Wildcard into Filenames

Something like that?

@echo off
setlocal
for %%a in (%*) do (
  echo Processing file: [%%a]
  YourProgram.exe "%%a"
)
Random Solutions  
 
programming4us programming4us