How to store the output of batch (CALL) command to a variable
问题 I have the batch file which has the command to call second.bat file. It will produce single line of output when it called. I want to store that line into variable. CALL second.bat I have tried using the following lines of commands but no use FOR /F "tokens=* USEBACKQ" %%F IN ('COMMAND') do SET result=%%F FOR /F "tokens=1 delims= " %%A IN ('COMMAND') DO SET NumDocs=%%A I don't know what to replace with COMMAND 回答1: As the help will tell you, COMMAND should be the command you want to run and