How do I write a batch script that loops through each line in a text file and stores the line in a variable in the loop?
For example I have:
@echo off
for /F "tokens=*" %%A in (C:\Users\pmandayam\git\devops\UserRegistrationServices\scripts\file.txt) do (
set var1=%%A
echo %var1%
)
For some reason, the output keeps printing echo is OFF.
multiple times, instead of the actual line