0

I need to put the content of a command inside a variable The command is

findstr dftFileName test

but the output of this batch is the command itself

set one=findstr dftFileName test
echo %one%
Noomak
  • 371
  • 5
  • 19
  • This is batch not bash. To get the output of a command you need a [for /f](http://ss64.com/nt/for_f) A variable in batch can hold only one line. –  May 25 '17 at 19:04
  • 2
    Possible duplicate of [Windows batch files: How to set a variable with the result of a command?](https://stackoverflow.com/questions/889518/windows-batch-files-how-to-set-a-variable-with-the-result-of-a-command) – aschipfl May 26 '17 at 13:29
  • Possible duplicate of [Put command output into a variable](https://stackoverflow.com/questions/10130768/put-command-output-into-a-variable) – Riccardo La Marca Mar 15 '18 at 16:34

0 Answers0