Skip to content

Instantly share code, notes, and snippets.

@pavelburov
Created January 26, 2018 14:10
Show Gist options
  • Save pavelburov/4dd76f12ef2d08c401bf54ec344efae9 to your computer and use it in GitHub Desktop.
Save pavelburov/4dd76f12ef2d08c401bf54ec344efae9 to your computer and use it in GitHub Desktop.
windows batch (bat, cmd) - How to set command output to variable
for /f %%i in ('application arg0 arg1') do set VARIABLE=%%i
echo %VARIABLE%
@ahsan2000
Copy link

I don't how it ran successfully in your side the correct syntax is:
for /f %i in ('findstr /r "[0-9]" hotfix.tt') do set VARIABLE=%i

@JoshuaRamirez
Copy link

Double percent is for scripts and single is for command line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment