Computer Hope
Microsoft => Microsoft DOS => Topic started by: Toyman on October 24, 2017, 10:00:00 AM
-
I'm batching a series of 'Call' commands to back up critical files to multiple devices (external drives, etc) and would like to display a line saying ". . . working . . ." that repeats or flashes until a called program completes. My users complain that because the screen shows nothing during lengthy file-backups, they're not sure anything's happening.
Using FOR has been unsuccessful I'm guessing because my use of syntax/switches is wrong.
Thoughts?
Toyman
-
Just a demo you may find helpful.
@echo off
setlocal enabledelayedexpansion
for /f %%a in ('copy /z "%~dpf0" nul') do set "cr=%%a"
set "busy=|/-\"
set /a n=0
::spinner
for /l %%i in (0,1,10) do (
set /a "n=%%i%%4"
for /l %%n in (!n! 1 !n!) do set /p "=In Progress !busy:~%%n,1! !cr!"<nul:
ping -n 2 127.0.0.1 >nul:
)
Good luck. 8)
-
Thanks, Sidewinder.
The segment (your inserted code) had to time out before continuing to the 'call' command. Since the called program runs in the background, I'm not there yet. Still have the blank screen.
I think invoking ANSI.SYS and piping the ESC code to it from the Call line might work. ESC[5m = blinking text.
I'm not having luck with that - yet. But your answer prompted a search in the forum where I found a section about using ANSI.SYS. My education continues.
I appreciate your effort.
Toyman
-
Wanted to say ... "Welcome Back Sidewinder" ... been a while since I saw you here 8)
-
Been a while...i agree Welcome back