Write Robocopy batch output to a text file trouble

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.

user439448

Posted 2015-12-25T11:59:51.810

Reputation:

You may need to redirect error messages, which can be done using 2> instead of (or in addition to) the plain >. – Thomas Dickey – 2015-12-25T12:16:31.333

Answers

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

Pimp Juice IT

Posted 2015-12-25T11:59:51.810

Reputation: 29 425