1

We can set the value of a variable (say, "upper_bound") in a batch file in the following way:

SET upper_bound=3

But is there any way to read this value '3' from a input.txt file which will just contain value 3?

  • Please provide a more clear example of what will be in the input.txt file. – Squashman Oct 27 '16 at 15:59
  • 1
    Possible duplicate of [Windows Batch: Set Variables from Text File](http://stackoverflow.com/questions/5886334/windows-batch-set-variables-from-text-file) – aschipfl Oct 27 '16 at 16:09
  • input.txt will just contain the value of the variable (say, 3) @Squashman –  Oct 27 '16 at 16:16

1 Answers1

2

Like this:

SET/P upper_bound=<input.txt
Compo
  • 36,585
  • 5
  • 27
  • 39