How to insert the output of a command to variable in a batch file?

后端 未结 3 515
情深已故
情深已故 2021-01-22 10:41

Inside a batch file on Windows I would like some variable to have the output of dir /b command.

How this can be achieved ?

3条回答
  •  天涯浪人
    2021-01-22 11:22

    Batch files didn't handle this use case very well. I did find one thread that describes a technique using temporary files.

提交回复
热议问题