Use FOR to use the .bat file names

1

I'm having a problem trying to make my script read all the files in a folder to assign variables.

At this moment it works as I do with a list in which I set the path of the file.

Is there any way for the script to go through the servers folder instead of using that first FOR and use the names of the files it has visited before in the 2nd FOR?

The script

for /F "tokens=*" %%c in (servers\lista.txt) do (
    %%c
)
for %%a in (%s1% %s2% %s3%) do (
    call :start %%a
)

File list:

set s1=servers\xxx.txt
set s2=servers\yyy.txt
set s3=servers\zzz.txt

Servers folder contains file lista.txt and files xxx.txt , yyy.txt , zzz.txt , etc.

Sorry I explained a little badly. In the files xxx.txt yyy.txt etc. there are only several set of other variables like the ip address or the username.

What I'm looking for is that the second for instead of using the variables that I pass in list.txt use all the files in the servers folder, in this example xxx.txt yyy.txt zzz.txt referenced as s1 s2 and s3.

Sorry I explained a little badly. In the files xxx.txt yyy.txt etc. there are only several set of other variables like the ip address or the username.

What I'm looking for is that the second for instead of using the variables that I pass in list.txt use all the files in the servers folder, in this example xxx.txt yyy.txt zzz.txt referenced as s1 s2 and s3.

    
asked by juan 26.07.2017 в 09:22
source

0 answers