Page tree

Welcome to FreeSoftwareServers Confluence Wiki

Skip to end of metadata
Go to start of metadata

https://stackoverflow.com/questions/6359820/how-to-set-commands-output-as-a-variable-in-a-batch-file

FOR /F "tokens=* USEBACKQ" %%F IN (`command`) DO (
SET var=%%F
)
ECHO %var%

Note:

If you need to use | in command use ^|
  • No labels