入力を受け取り、簡単な計算を行う短いバッチ ファイル プログラムに取り組んでいます。最初のエコー以外はすべて正しく動作しているようです。コードは次のとおりです。
set /p usercommand= "Input:"
if "%usercommand%" equ "done" (
set /p usertimeouthours= "Input Hours: "
echo (%usertimeouthours%)
set /p usertimeoutminutes= "Input Minutes: "
echo (%usertimeoutminutes%)
set /p usertimeoutseconds= "Input Seconds: "
echo (%usertimeoutseconds%)
set /a answer= %usertimeouthours%*3600+%usertimeoutminutes%*60+%usertimeoutseconds%
echo %answer%
goto end
) else (
echo finished
goto user
)
:end
最初のエコーのみが出力されるのはなぜですか
(
私の推測では、if ステートメントに何か問題があると思います。変更方法を知っている人はいますか?
ありがとう!