@echo off if "%~1" == "" ( echo EMPTY goto :EOF ) if "%~1" == "0" ( echo ZERO goto :EOF ) set /a number_var=%~1 2>nul if errorlevel 2 ( echo ILLEGAL goto :EOF ) if %~1 neq %number_var% ( echo ERROR goto :EOF ) set number_var goto :EOF
Monday, 15 June 2009
Validate number arguments within CMD/BAT
Ярлыки:
algorithms,
cmd-bat,
windows
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment