XCOPY does not work (nothing happens)
Top  Previous  Next


XCOPY.EXE was created in a way that it must be assigned an input handle in order to work. Use the echo command and a vertical bar character to create the needed handle.

Example 1 - pipe nothing to xcopy

DOS echo | xcopy w:\OldDir w:\NewDir\ /s

The echo command can also be used to pipe the correct answer to a question -

Example 2 - pipe a "d" character to the question "Does W:\newdir specify a file name or directory name on the target (F = file, D = directory)?"

(This question is not asked if the directory already exists or if there is a backslash after "w:\NewDir" like in example 1.)

DOS echo d| xcopy w:\OldDir w:\NewDir