コマンドの実行結果を環境変数に格納する BAT
ただし1ライン限定
@echo off for /f "delims=" %%i in ('%~2') do set %1=%%~i
>setresult test "echo hello" >echo %test% hello
ただし1ライン限定
@echo off for /f "delims=" %%i in ('%~2') do set %1=%%~i
>setresult test "echo hello" >echo %test% hello