I am trying to save a batch variable into a text file. I currently have this code:
@echo off
Set var=6
@echo %var%>txt.txt
For /f "tokens*" %%i in (txt.txt) do @echo %%i
Pause
It's supposed to save the 6 into the variable var and then write the variable in a text file. I want to do this to save user input into a text file so that when the batch program is terminated it will hold the variables.