Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.