Jump to content

Check out our Community Blogs

Register and join over 40,000 other developers!

Recent Status Updates

View All Updates

- - - - -

Interactive Batch Countdown Timer

timer countdown countdown timer

  • Please log in to reply
1 reply to this topic

#1 dscheive


    CC Lurker

  • Just Joined
  • Pip
  • 1 posts

Posted 23 September 2009 - 04:04 PM

Hi! im a fairly good batch programmer and im struggling to create a countdown timer in batch that will allow me to just input a time in seconds and have it countdown from their. Please dont recommend software cause this needs to be able to be run on a computer at work. thx!
  • 0

#2 Guest


    CC Devotee

  • Expert Member
  • PipPipPipPipPipPip
  • 914 posts
  • Programming Language:C

Posted 23 September 2009 - 09:08 PM

I don't use Windows anymore, but I used to program in batch. This might work, but I am not sure.
@echo off
set /p input=Seconds:
echo %input%
set /a input=%input%-1
ping localhost -w 1 > nul
if %input%=0 goto exit
goto loop

  • 0

Also tagged with one or more of these keywords: timer, countdown, countdown timer

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download