title: Saving a batch variable in a text file
body: <p>I am trying to save a batch variable into a text file. I currently have this code:</p>
  
  <pre><code>@echo off
  
  Set var=6
  @echo %var%&gt;txt.txt
  
  For /f "tokens*" %%i in (txt.txt) do @echo %%i
  Pause
  </code></pre>
  
  <p>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.</p>