I am testing a written program that has 1 file as input. Tests need to be done a lot, each time writing in the console is somehow sad. Is it possible to make a batch file that will run exe alternately with each file from a specific directory?
- Can. There are definitely bat cycles. - Vladimir Martyanov
- There is, but I have not figured out how it works yet, that's why I wrote - Stanislav Suslov
|
1 answer
@echo off :: первый параметр батника - каталог for /F %%f in ('dir /B/D %1') do ( echo %1/%%f ) Or even easier:
for %%f in (%1/*.*) do ( echo %1/%%f ) - Not much help ( - Stanislav Suslov
- And more specifically - what exactly does not work? - gottar
- Yes, I basically did not understand the logic of this thing (I never wrote scripts at all). Why / F if you only need a launch? Why flags / b and / d? And most importantly - no reaction to the addition of start to the body. - Stanislav Suslov
- "Why flags / B and / D?" do not need - do not add, or use your flags. Or even do without
dir, see the second option. "no reaction to the addition of start to the body" - and what should it be? - gottar - I did not want to run exe with the parameter from the loop. Took a simpler version, added start there "..." ... exe% ff and all the way. Thanks to everyone who responded! - Stanislav Suslov
|