tim
tim

Reputation: 407

how to silence robocopy when mirroring directory

I would like to mirror a directory with robocopy without any output except for the status header and the summary at the end. The command I am using at the moment is robocopy /MIR /NFL /NDL /NC /NS /NP dir1 dir2. If I create a file in dir2 that is not present in dir1 and run this command it gets deleted (as expected) but also generates output (not expected and not wanted). Is there a way to make robocopy behave like I want?

Edit: I still want to see the Job Header and Job Summary though.

Upvotes: 1

Views: 2353

Answers (1)

Stephan
Stephan

Reputation: 56180

Yes, you can redirect the output (Stream 1 for Standard Output, Stream 2 for Error output) either to NUL (just disregard it) or to a file (for later viewing):

robocopy /MIR /NFL /NDL /NC /NS /NP dir1 dir2 >nul 2>&1

or

robocopy /MIR /NFL /NDL /NC /NS /NP dir1 dir2 >robolog.txt 2>&1

Upvotes: 2

Related Questions