I am trying to read from file and assign the read value to variable and perform a task. However I see that I succeed in reading value correctly from file, however the assignment part doesn't work fine. Also I am struggling to clear the set value post assignment. I have looked at SO-link1 for reading and assigning value and SO-link2 for clearing the assigned value
Based on the link provided I added below line but it doesnt solve the problem
setlocal enabledelayedexpansion
To add more my key file has numbers like below
12456
23890
45389
12690
Code Snippet:
for /F "delims=" %%x in (key.txt) do
(
echo value read from file -- %%x **Shows correct value**
set "SERIAL=%%x"
echo number which got assigned -- %SERIAL% **Shows incorrect value**
set "SERIAL=" ** Doesnt clear the set value**
)