I have 2 batch files.
The first one needs an input argument which is a path of a parent folder. It reads the names of all subfolders inside the parent folder and executes the second batch file for each subfolder.
BATCH FILE 1
@echo off
for /d %%Y in (%1/*) do (
set SubfolderNameAndPath=%%Y
call batch2.bat %SubfolderNameAndPath%
)
The second batch file uses as input argument the SubfolderNameAndPath and executes an Evaluate.exe for all the files that exist in each subfolder. It saves the results of the Evaluate.exe to a text file "results" with an extension that carries the name of the subfolder that each time has been accessed. (results_%~n1.txt
).
BATCH FILE 2
@echo off
for %%X in (%1/*) do (
echo Evaluate.exe %%X AnotherArgumentHere -o results_%~n1.txt
)
When I run the batch1 (batch1.bat ParentFolderPath
) even if it seems to call the batch2.bat, the batch2.bat is not executed. I believe that something goes wrong with the way that I define the input arguments for the batch2.bat but I cannot figure out what it is.
The %SubfolderNameAndPath%
does not contain any spaces. Neither the path to the folder does.
I would really appreciate your help on that.