Long duration of performing a command

F

Fyodor Koryazhkin

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.
 
B

billious

Fyodor Koryazhkin said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top