Robocopy Output Editing RRS feed

  • Question

  • Im familiar with the switches available with robocopy, but I've seen something similar to what I have below done with the stdout of DiskPart. I need to cut a huge chunk of irrelevant but consistent info out of the output of each line during a robocopy. I don't have a machine in front of me right now, but I was wondering if anything similar has already been done or if anyone could point out something about robocopy that would make this logic useless as a means to edit the output. It's not perfect, but you should be able to tell where I'm headed with it.

    Any advice is appreciated.



    ECHO This Header
    ECHO ================
    EXIT /B


    FOR /F %%a IN ('ROBOCOPY %SRC% %DST%') DO(
      IF ROBO_LINES==20 (
        SET /A ROBO_LINES=0
        CLS & CALL :Header
      ECHO %a:ThisString=%

    Basically, cut out the junk string on each line out and clear the screen to make room when it prints about 20 lines. I've already used switches to cut robocopy's output down, but I need to remove a long string in the filenames that are the same through the whole process.

    • Moved by Bill_Stewart Tuesday, October 11, 2016 6:13 PM Vague/abandoned
    Wednesday, August 10, 2016 4:40 AM

All replies