I am doing a process to copy different files from different folders, with the particularity that I need to pass, for example, 30 files of a directory (which contains more than 100). The 30 that I must pass, no matter what they are, should be 30.
I did something similar to this, here I use it to show the names just:
set contador=0
FOR /R d:\Users\usuario\Desktop\ %%A IN (*) DO (
IF %contador% LSS 3 (
echo %%A
echo %contador%
SET /a contador=contador+1
)ELSE (
EXIT
)
)
What happened was that inside the FOR, the counter was always "0". If I printed it outside of the FOR, it would have the correct number. So I realized that the FOR criteria for each file inside the directory (the *) does not work for me.
How do I limit it? so that it travels only 30 files and not all those that are inside the folder?
Thanks and regards!