Fyodor Koryazhkin
10-30-2005, 01:33 PM
Hi,
During execution of some ciclyc commands such as xcopy or "for" cycle I do
not want to show the user what is going on behind the scene i.e. redirectig
the output of the command to nul or a log file. But from the other side I
would like to notify the user that the program is not stuck, espcially during
long-time consuming "for" cycle.
Is there any possibility to show the user some moving signs such as spinning
slash or moving dots or something like that?
Thank you.
billious
10-30-2005, 03:28 PM
"Fyodor Koryazhkin" <fyodork@smarteam.com> wrote in message
news:b590e6a42e3c8c7ab7e12da3b82@news.microsoft.com...
>
> Hi,
>
> During execution of some ciclyc commands such as xcopy or "for" cycle I do
> not want to show the user what is going on behind the scene i.e.
> redirectig the output of the command to nul or a log file. But from the
> other side I would like to notify the user that the program is not stuck,
> espcially during long-time consuming "for" cycle.
>
> Is there any possibility to show the user some moving signs such as
> spinning slash or moving dots or something like that?
>
> Thank you.
>
>
No doubt it could be done - it really depends on what kind of display you
want, how accurate you want the display and the precise details of your
process.
For instance, you could create a new batch (xcopy_process.bat) which did the
XCOPY then deleted a flag file (flag_file.) THEN, in your main procedure you
could try
dir>flag_file
START /min "" xcopy_process
:loop
ping -n 5 127.0.0.1 >nul
if exist flag_file echo at %date %time% XCOPY was continuing&goto loop
echo XCOPY finished...
Or, along the same lines if you were XCOPYing to a new directory
dir>flag_file
START /min "" xcopy_process
:loop
ping -n 5 127.0.0.1 >nul
for /f %%i in ('dir \destinationdirectory^|find "File(s)" ') do set yfc=%%i
if exist flag_file echo at %date %time% %yfc% files copied&goto loop
echo finished copying %yfc% files
Or perhaps if you structure your code appropriately,
set yfc=0
for %%i in (\path\filemask) do call :monitor&xcopy "%%i" \destination
....
:monitor
set /a yfc=1+yfc
if not yfc==10 goto :eof
echo at %date% %time% continuing
set yfc=0
....many ways - depends on your requirements. More info needed.
HTH
....Bill