"leo" wrote
> I want the screen to display the seconds as they elapse


For a general countdown that works under NT/2K/XP/K3, try the following:

*******

C:\GuardPost>ntlib /q :FNL countdown.cmd

C:\GuardPost>type %_FNL%
1. @FOR /L %%A IN (%1,-1,1) DO @(
2. (ECHO:%%A loops to go)
3. (%.Show% ECHO:%%A second^(s^) remaining...)
4. (%.Wait% 1)
5. )

{without redirection}

C:\GuardPost>countdown 5
5 loops to go
5 second(s) remaining...
4 loops to go
4 second(s) remaining...
3 loops to go
3 second(s) remaining...
2 loops to go
2 second(s) remaining...
1 loops to go
1 second(s) remaining...

{with redirection}

C:\GuardPost>countdown 5 >logfile.txt
5 second(s) remaining...
4 second(s) remaining...
3 second(s) remaining...
2 second(s) remaining...
1 second(s) remaining...

C:\GuardPost>type logfile.txt
5 loops to go
4 loops to go
3 loops to go
2 loops to go
1 loops to go

C:\GuardPost>

*******

The self-documenting MountCommand ".Show" will force output to the console
even in a redirected script. See
(http://TheSystemGuard.com/MtCmds/RedirRapids/Show.htm) for color-keyed
examples of using the MountCommands

.Show
.ShowErr
.ShowAll

The .Wait command and the File_Number_Lines (:FNL) Procedure are both part
of the (FREE) Advanced NT/2K/XP Command Library (ntlib.cmd).

For longer wait times, you may also be interested in the $WAITFOR function.
See (http://TheSystemGuard.com/NTCmdLib/F...ns/WAITFOR.htm).

*******
Notes:

1. .Mount/\Commands are constructed using ONLY builtin
commands common to all four platforms (NT/2K/XP/K3).
2. .M/\C's are NOT case sensitive. Mixed case is used
for visual clarity only.
3. ntlib.cmd provides over 100 resources to assist with
writing and documenting cross-platform scripts,
including 57 .Mount/\Commands. You can obtain it
(for FREE) at (http://ntlib.com).

*******

TheGuardBook contains a "Mounted Help" page for each internal cmd.exe
command. This is a single color-coded page, highlighting the differences
among the NT/2K/XP/K3 versions. The complete help text for each OS is also
available for comparison (http://TheSystemGuard.com/TheGuardBook/CCS-Int).

*******

-tsg
__________________________________________________ __________
TheSystemGuard.com | BoomingOrFuming.com | MountCommands.com
Free and "Almost Free" Knowledge for Windows System Admins!