Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
I'm trying to write a batch file that asks for a number and then uses an external program (which inserts a delay into the file) to delay for that number of seconds. Each time the set amount of time is up, it displays a message and then starts the timer again. However I can't get it to work.
BTW, the external program (called SLEEP.EXE) has to be in the same directory as the batch file to work. You can download it from here.
Here is what I have so far:
***IntervalTimer.bat***
@ECHO OFF
:credits
ECHO Interval Timer
ECHO.
ECHO uses the "SLEEP.EXE" program, downloadable from
ECHO.
ECHO http://www.computerhope.com/
SLEEP 5:settimer
ECHO Set the respawn time for the Nature rune chest.
set choice=
set /p choice=Enter the respawn time for the Nature rune chest in seconds.
if not '%choice%'==" set choice=%choice:~0,1%
if '%choice%'>'100' goto timer
if '%choice%'<'100' goto settimerECHO "%choice" is not valid. Please try again.
ECHO.
goto settimer:timer
sleep %choice%
goto timer2:timer2
goto timer:end
Thankyou for your help.---
DeeJay

David,
Ignoring all the prompting for now, you can use ping as a timer. And it's already in the standard path.
Like this:
ping 127.0.0.1 -n #
where # is the number of seconds.
What's not working with what you have?
M2Mechanix2@Golden-Triangle.com

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |