環境変数を利用して結果を取得する。
■ helloenv.c
int main(void){
return 8;
}
■ helloenv.bat
@ECHO OFF
helloenv.exe
echo %ERRORLEVEL%
■ 結果
> helloenv.bat
8