I would keep making a script to check the number of files in folders. To do this I stored my folders in an array like this:
set myArray[0]="C:\testFolder\test1\"
set myArray[1]="C:\testFolder\test1\"
To do that, I initiated a variable to count the number of files.
set /a filesCount=0
then I create loops to iterate over the array
for %%v in (0, 1, 1) do (
for /r %myArray[%v%]% %%i in (*.*) do (
set filesCount+=1
)
echo %filesCount%
)
In my first folder, I have 1 file but the program systematically returns me 0 for the variable filesCount. I want it to show me 2 for the first folder and 0 for the second.
I try this also:
for %%v in (0, 1, 1) do (
for /r !myArray[%v%]! %%i in (*.*) do (
set filesCount+=1
)
echo %filesCount%
)
and this:
for %%v in (0, 1, 1) do (
for /r %myArray[%%v]% %%i in (*.*) do (
set filesCount+=1
)
echo %filesCount%
)