set variable multiple value [SOLVED]
Posted: 12 Jun 2024 08:03
Hi, I'm trying to create a batch file script to save all the folders within C:\Users that contain student name in a variable, I managed to get to the point where I return the folder name but I couldn't save the name of more than a folder in the same variable.
EX: C:\Usuários\Aluno1
C:\Usuários\Aluno2
C:\Usuários\Aluno3
C:\Usuários\Aluno4
I would like the variable to return
profile_delete=Student1 Student2 Student3 Student4
for /f %%a in ('"dir /b C:\Users |findstr /i aluno"') do (
echo %%a
pause
)
Could someone help me?
EX: C:\Usuários\Aluno1
C:\Usuários\Aluno2
C:\Usuários\Aluno3
C:\Usuários\Aluno4
I would like the variable to return
profile_delete=Student1 Student2 Student3 Student4
for /f %%a in ('"dir /b C:\Users |findstr /i aluno"') do (
echo %%a
pause
)
Could someone help me?