Search
 
SCRIPT & CODE EXAMPLE
 

BASIC

dos assign command output to variable (when output is a single line)

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

dos assign command output to variable (when output is of multiple lines)

SETLOCAL ENABLEDELAYEDEXPANSION
SET count=1
FOR /F "tokens=* USEBACKQ" %%F IN (`command`) DO (
  SET var!count!=%%F
  SET /a count=!count!+1
)
ECHO %var1%
ECHO %var2%
ECHO %var3%
ENDLOCAL
Comment

PREVIOUS NEXT
Code Example
Basic :: how to remove characters from the end of a string visual basic 
Basic :: dos assign command output to variable (when output is of multiple lines) 
Basic :: how to dynamically change the font size of a button visual basic 
Basic :: sequnce function vb.net 
Elixir :: how to split string in elixir 
Elixir :: generate random number elixir 
Elixir :: phoenix system get env 
Elixir :: elixir enum any 
Elixir :: elixir strings 
Elixir :: elixir pipeline 
Scala :: array in scala 
Scala :: scala tutorial 
Scala :: scala anonymous function 
Actionscript :: how to take value only from the checked checkbox 
Excel :: google sheets convert month to number 
Excel :: or logic excel 
Perl :: perl while loop 
Perl :: comments in perl 
Pascal :: pascal delay 
Powershell :: powershell remove node_modules 
Gdscript :: gdscript vector2 
Lisp :: print lisp 
Assembly :: regex find a word index of all matches 
Assembly :: vba concatenate strings and integer 
Javascript :: jquery vslidation remove spaces from input 
Javascript :: jquery remove required attribute 
Javascript :: react refresh page 
Javascript :: javascript void(0) href 
Javascript :: get tomorrows date using moment 
Javascript :: random number between 0 and 3 
ADD CONTENT
Topic
Content
Source link
Name
2+1 =