Long duration of performing a command

Discussion in 'Microsoft Windows 2000 CMD Promt' started by Fyodor Koryazhkin, Oct 30, 2005.

  1. 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.
     
    Fyodor Koryazhkin, Oct 30, 2005
    #1
    1. Advertisements

  2. Fyodor Koryazhkin

    billious Guest

    "Fyodor Koryazhkin" <> wrote in message
    news:...
    >
    > 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
     
    billious, Oct 30, 2005
    #2
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. guard

    Re: command line 'find' command

    guard, Jul 30, 2003, in forum: Microsoft Windows 2000 CMD Promt
    Replies:
    0
    Views:
    555
    guard
    Jul 30, 2003
  2. Roger Johnson

    pipe file input into command line command

    Roger Johnson, Aug 1, 2003, in forum: Microsoft Windows 2000 CMD Promt
    Replies:
    0
    Views:
    726
    Roger Johnson
    Aug 1, 2003
  3. Eric

    Permission Denied while running cscript command in command prompt

    Eric, Oct 3, 2003, in forum: Microsoft Windows 2000 CMD Promt
    Replies:
    0
    Views:
    752
  4. Sam Low

    How do I include long filenames in the FOR command?

    Sam Low, Dec 6, 2004, in forum: Microsoft Windows 2000 CMD Promt
    Replies:
    1
    Views:
    242
    Paul R. Sadowski [MVP]
    Dec 6, 2004
  5. command line prompt showing how long last command took?

    , May 17, 2006, in forum: Microsoft Windows 2000 CMD Promt
    Replies:
    13
    Views:
    645
    Mark V
    May 31, 2006
Loading...

Share This Page