There's random amount of files in the directory with same extension.
E.g.
file1.txt
file2.txt
file3.txt
Need to scan the directory and set each filename to a new variable. We can do something like this:
for %%A in ("*.txt") do (
set var=%%~nA
)
But it sets the filenames to that same one variable and at the end only last variable is active, so in this example it will always be just file3.
Need to set each filename to new variable so those variables can be used later.
var1=file1
var2=file2
var3=file3
Also if there's X amount of .txt files that means X amount of variables has to be created. So in this example if there's only 3 files, 3 variables are created.