I need to know what is the precise difference between these 2 commands ?
-
What operating system are you using? – Ross Ridge May 24 '19 at 21:06
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.
-
2xcopy will not copy the subdirectories unless you add /e or /s to the command. – Bernhard Eriksson May 24 '19 at 10:12
Another difference I experienced, with W10 batch command copy didn't copy a file to OneDrive and xcopy did. Don't know why, it just worked.