Failed to perform copy command due to error: failed to initialize enumerator: cannot use directory as source without –recursive or a trailing wildcard (/*)

Error: failed to perform copy command due to error: failed to initialize enumerator: cannot use directory as source without –recursive or a trailing wildcard (/*)

Explanation:

This error message is encountered when attempting to use the copy command without properly specifying the source directory. The error is specifically related to not using the --recursive flag or a trailing wildcard (/*) when referencing a directory as the source.

When using the copy command, if the source is a directory, you need to include the --recursive flag to copy all the files and subdirectories within that directory.

Here is an example to better understand the solution:

copy /path/to/source/directory /path/to/destination/directory --recursive

In the above example, /path/to/source/directory specifies the source directory, and /path/to/destination/directory specifies the destination directory. The --recursive flag ensures that all files and subdirectories within the source directory are copied as well.

Read more

Leave a comment