How do i get the first line of a txt file and set it as a %variable% in Batch? : <p>I would like to send a number to file.txt as a temporary storage for another variable, which can easily be done. I just can't work out what to use to extract the first line of file.txt (which is a number ranging 1-100000) and set it as a %variable% in my running batch script.</p>

<p>So by the end of it I should be able to do echo %first-line-of-file.txt% and it'll print x</p>

<p>Any ideas on how to make this work is much appreciated </p>
