I have a batch program that you run like:
wait.bat 20 < That will wait 20 seconds.
It works with the help from VBScript but it brings up a window if there is an error which I wan't my own error message, so how can I check the %1 variable for anything but numbers?
PLZ HELP!
Thanx!
@echo off
if "%1"=="" goto error2
set /a sec=%1*1000
>%temp%\$$$.vbs echo WScript.Sleep(%sec%)
start /wait %temp%\$$$.vbs
goto end
:error1
echo Wait.exe
echo ------------------------------
echo ERROR#1: DO NOT USE LETTERS.
echo USAGE: wait.exe (seconds)
echo ------------------------------
pause
goto end
:error2
echo Wait.exe
echo ------------------------------
echo ERROR#2: NO SECONDS GIVEN TO WAIT.
echo USAGE: wait.exe (seconds)
echo ------------------------------
pause
:end
If it detects anything but numbers I would like it to goto :error1
When it's done I'm compiling with Quick BFC
[attachment deleted by admin]