1

I want to write the output of a Robocopy command into a text file that I can review to see which files were copied and so forth.


I tried these commands...

robocopy drive:\ destination:\ /e /v>log.txt
robocopy drive:\ destination:\ /e /v /l>log.txt 

but none of them worked.

Furthermore, I also tried both commands with >>log.txt instead of >log.txt using both forms of redirection in that syntax variation but still didn't work.

1
  • You may need to redirect error messages, which can be done using 2> instead of (or in addition to) the plain >. Dec 25, 2015 at 12:16

1 Answer 1

2

Having Robocopy command output to file trouble. . .

Use the below command syntax instead since Robocopy has its own logging options just use those

ROBOCOPY "drive:\" "destination:\" *.* /E /V /NP /R:5 /LOG+:log.txt /TS /FP

Note: /LOG+:file in particular.

Use Robocopy /? and/or the below resource link to see all the available options.

/E         :: copy subdirectories, including Empty ones.
/V         :: produce Verbose output, showing skipped files
/NP        :: No Progress - don't display % copied.
/R:n       :: number of Retries on failed copies: default 1 million.
/LOG+:file :: output status to LOG file (append to existing log).
/TS        :: include source file Time Stamps in the output.
/FP        :: include Full Pathname of files in the output.

Supporting Resource

You must log in to answer this question.