I just started learning batch files, and there are many things I don't understand how to implement. Could you experts help me improve the batch file below so it can meet the following requirements? Thank you!
I want to add batch statements at ::a and ::b to check whether the month and date are within range. The number cannot be 0, or greater than 12, or greater than 31. Letters and spaces must not be allowed as input either. If the input is wrong, return to start.
If there is a better way to handle this, I also hope the experts can suggest it. Thank you!
[ Last edited by HAT on 2009-2-9 at 02:13 ]
I want to add batch statements at ::a and ::b to check whether the month and date are within range. The number cannot be 0, or greater than 12, or greater than 31. Letters and spaces must not be allowed as input either. If the input is wrong, return to start.
If there is a better way to handle this, I also hope the experts can suggest it. Thank you!
@echo off
:start
set /p input=请输入月份:
::a
set /p date=请输入日期:
::b
echo
pause
goto start
end[ Last edited by HAT on 2009-2-9 at 02:13 ]
