Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a file, build-version.txt, that contains the build number "1.2.3". I want to store this build number in an environment variable. In Unix, I would do something like:

version=$(cat build-version.txt)

How do I do this in Windows? The following doesn't do what I want:

set VERSION=type build-version.txt
share|improve this question
for /F %%i in ('echo test') do (echo %%i) but I am sure this is dupe. – Vlastimil Ovčáčík Sep 28 '13 at 11:30
up vote 0 down vote accepted

Just use: set /P VERSION=< build-version.txt

and you can check with command: echo %VERSION%

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.