Search code examples
command-promptdos

What is the difference between copy and xcopy command?


I need to know what is the precise difference between these 2 commands ?


Solution

  • Quoting from the result of copy /?

    Copies one or more than one files to another location.

    Quoting from the result of xcopy /?

    Copies files and directory trees.

    The essential difference between the two commands is that when you provide the path of a folder to copy, only the files in that folder will be copied to the specified destination.

    Providing the path of a folder to xcopy will copy the folder itself along with its contents (subject to flags used with the command) to the specified destination.