Sign up ×
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute:

I'm using robocopy to do backups with a PowerShell script, and it's pretty awesome, except that I'd like it to only show the progress percentage while it copies and not all of the other information.

The other information clutters the command window, which I'd clean and simple so that it's easy to see the overall progress of the backup.

Is this possible?

Thanks, Andrew

share|improve this question

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.
share|improve this answer
    
That's good. Note that in the original question I did specify that I still wanted the progress percentage, but this works well if you don't want anything to display. – AndyGeek Sep 20 '11 at 20:26
    
There's still a "100%" message displayed. – Scott Chu Mar 5 '13 at 13:58
    
@ScottChu you realise that to display 100% at the end, is not a progress bar, right? and would serve no use either. And anyhow, it does not display 100%. The answer posted makes robocopy completely silent – barlop Jul 21 '14 at 8:28
4  
This still prints a single empty line which is noticeable in batch files. – wqw Nov 2 '14 at 14:37
up vote 13 down vote accepted

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

share|improve this answer
2  
/nfl to suppress file name – xagyg Mar 2 '13 at 11:18
    
heh, nfl....... – contactmatt Sep 5 '13 at 17:23
3  
Appears if you use /mir or /purge the extra files are still logged. Can't find a way to turn that off. – bbodenmiller Apr 14 '14 at 18:08
    
note that with robocopy the progress bar is only % per file, doesn't show progress with the overall number of bytes copied out of the total / % of that. – barlop Jul 21 '14 at 8:37

In PowerShell, I like to use:

robocopy src dest | Out-Null

It avoids having to remember all the command line switches.

share|improve this answer

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
share|improve this answer
5  
also > NUL just chucks the output away, no file to worry about. – Mr Universe Feb 21 '14 at 3:26
2  
> NUL didn't work for me but log:NUL did – bbodenmiller Apr 14 '14 at 18:27
    
or pipe to Out-Null in PowerShell – orad Oct 20 at 18:36

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

robocopy src dest > log:nul

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

share|improve this answer
1  
I test > log:nul under win8.1 x64, there is a empty log file. > nul works as expected. – Ivan Yan Apr 4 at 14:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.