27

I've had a look at the switches for XCOPY and can't seem to find one that suppresses the confirmation of the number of files that have been copied.

Do you know if this is possible?

Thanks in advance,

Dave

Kungfauxn00b
  • 567
  • 2
  • 5
  • 14

5 Answers5

37

you can simply send it to nul:

xcopy source destination options > nul
Endoro
  • 37,015
  • 8
  • 50
  • 63
18

If you want to see messages about which files are being copied but suppress the final message about how many files were copied, then you can use find:

xcopy source destination options|find /v "File(s) copied"

This will display all lines of output that don't contain the string "File(s) copied". Use the /F option to xcopy to display full source and destination filenames.

yoyo
  • 8,310
  • 4
  • 56
  • 50
  • Confirmed: this solution worked exactly as I needed. I had a perpetually running CMD file that I wanted to copy files in a source directory tree whenever a source file was updated. I was using > nul before to suppress too much output, but I wanted to change it to list the filenames whenever a copy occurred. Changing it to use FIND /V "File(s) copied" was perfect. – Aron Boyette Apr 07 '17 at 15:59
  • This only works if the system language is set to English. I can be adapted for your language settings, or for a more generic solution something like this could be used: `xcopy src dst opt |findstr "\\"`, but make sure you have a backslash in the source directory (e.g. use .`\src` if you're copying from a local directory). – 816-8055 Sep 06 '22 at 10:22
1

xcopy doesn't handle non-standard characters (e.g., «׃¿) ... use xxcopy instead: xxcopy "G:\Files\" /L /S /ZS

/ZS suppresses all the summary reporting and leaves only the filenames.

RKO
  • 161
  • 10
1

You can try this:

xcopy "C:\source_folder\test_file.txt" "C:\destination_folder" /Q > nul

/Q removes the file name while copying and >nul removes the prompt ".. File(s) copied"

Andy McRae
  • 525
  • 7
  • 15
0

Just use >nul 2>&1 will supress all the output of the the line.
For example echo Hello World >nul 2>&1 will have no output.

Benjamin2002
  • 311
  • 1
  • 4
  • 13