CMD or PS1 script to loop through for .inis in folder?

Homerboy

Lifer
Mar 1, 2000
30,856
4,974
126
I have a simple command file that runs off settings in an .ini file.
I have a bunch of different .ini files all in the same directory.

The command line for running a single .ini is something like

Set Automate=\users\JohnD.ini
F:\program\run.exe

Is there a simple loop script I can create that will run through ALL the .ini files located in \users\ whether there be 2 or 2,000?


Thanks in advance
 

Ken g6

Programming Moderator, Elite Member
Moderator
Dec 11, 1999
16,250
3,845
75
Use code tags. :colbert:

If I recall correctly, a batch for this would be something like:

Code:
for %%i in (\user\*.ini) do Set Automate=%%i && F:\program\run.exe

Not sure if you can skip the middleman and do the for loop on %Automate% or not.