Assign output of a program to a variable using a MS batch file

前端 未结 10 992
梦谈多话
梦谈多话 2020-11-22 10:06

I need to assign the output of a program to a variable using a MS batch file.

So in GNU Bash shell I would use VAR=$(application arg0 arg1). I need a si

10条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-22 10:56

    On Executing: for /f %%i in ('application arg0 arg1') do set VAR=%%i i was getting error: %%i was unexpected at this time. As a fix, i had to execute above as for /f %i in ('application arg0 arg1') do set VAR=%i

提交回复
热议问题