&tag(バッチファイル); *目次 [#c6769e04] #contents *関連ページ [#te8f3f99] *参考情報 [#l37f71cb] -[[炎のコマンドプロンプト入門/バッチファイル/ユーザー入力:http://www.geocities.co.jp/SiliconValley-SanJose/1227/batinput.html]] *制御構造 [#q6ed2f84] **エラー処理 [#te7652d8] ***%errorlevel%で判定する [#ib1fbc39] -次のような処理で判定できる。 #pre{{ @echo off call child.bat 0 echo errorlevel=%errorlevel% if %errorlevel% neq 0 goto error echo "good end" exit /b 0 :error echo "bad end" exit /b 1 }} -%errorlevel%の判定は拡張機能らしい。"IF ERRORLEVEL 0"といった処理とは異なるので注意!!(大文字で%なし)。 *Tips [#f0d07a22] **引数の渡し方 [#d2649f23] - %0:バッチファイル名、%1:1番めの引数、%2:2番めの引数、%*:全部の引数。 **バッチファイルで改行したい [#t6eb86b5] -行末に"^"(ハット)をつければいいらしい。[[バッチファイルで2行にわたるコマンドを入力したいのですが | その他(プログラミング)のQ&A【OKWave】:http://okwave.jp/qa/q2270635.html]]