I have a strange problem with a BAT file in Windows and I'm not sure what's happening.
I have created a bat file to go through the folders that I indicate by parameters. In the bat folder, I have an app folder and I want to get all the files that are inside it, in the folders that I indicate.
The call would be something like
mibat.bat folder1 folder2 folder3.
In the bat file I have the following code:
for %%a in (%*) do (
echo Recorriendo la carpeta %%a
set parameterFolder = %%a
set parameterPath = app\%parameterFolder%
for /R %parameterPath% %%v in (*.js) do (
echo %%v
)
)
The problem is that the route of the for is not taking it correctly and it removes all the files js that are inside the folder where the bat is, and not within app\folder1
, app\folder2
or app\folder3...
Does anyone know how I can solve this ???