Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I make robocopy silent in the command line except for progress?

People also ask

How do I stop robocopy in progress?

Just hit "Pause" to pause it and then hit Enter to resume it again.

How do I stop robocopy in CMD?

You'd need to close the cmd.exe process in which the robocopy batch script was running. To do that, I'd suggest you use a known title or command invoked so that you can parse and identify the item to send to taskkill . Of course ending a robocopy operation before it is finished isn't usually my recommendation.

How do I see progress in robocopy?

the default behavior of robocopy is to include percentages. Use /np to not include progress. it indicate the per-file percentage, not a percentage for the whole job.


I added the following 2 parameters: /np /nfl

So together with the 5 parameters from AndyGeek's answer, which are /njh /njs /ndl /nc /ns you get the following and it's silent:

ROBOCOPY [source] [target] /NFL /NDL /NJH /NJS /nc /ns /np

/NFL : No File List - don't log file names.
/NDL : No Directory List - don't log directory names.
/NJH : No Job Header.
/NJS : No Job Summary.
/NP  : No Progress - don't display percentage copied.
/NS  : No Size - don't log file sizes.
/NC  : No Class - don't log file classes.

I did it by using the following options:

/njh /njs /ndl /nc /ns

Note that the file name still displays, but that's fine for me.

For more information on robocopy, go to http://technet.microsoft.com/en-us/library/cc733145%28WS.10%29.aspx


If you want no output at all this is the most simple way:

robocopy src dest > nul

If you still need some information and only want to strip parts of the output, use the parameters from R.Koene's answer.


In PowerShell, I like to use:

robocopy src dest | Out-Null

It avoids having to remember all the command line switches.


robocopy also tends to print empty lines even if it does not do anything. I'm filtering empty lines away using command like this:

robocopy /NDL /NJH /NJS /NP /NS /NC %fromDir% %toDir% %filenames% | findstr /r /v "^$"

A workaround, if you want it to be absolutely silent, is to redirect the output to a file (and optionally delete it later).

Robocopy src dest > output.log
del output.log