What's wrong with this copy command?

This copy command

COPY FILE "M:\TEST" TO "X:\GRMS01\TEST" COPYDIRTIMES=yes COPYFILETIMES=yes COPYATTR=yes NONBUFIO=yes FORCE UPDATEALL WHENEXISTS=replacenewer

creates the directory

X:\GRMS01\TEST\TEST

=> That is not that what I await!

When I run the DOS copy command:

copy M:\TEST X:\GRMS01\TEST

I get the file

X:\GRMS01\TEST\blabla.txt

and not the directory

X:\GRMS01\TEST\TEST
and file
X:\GRMS01\TEST\TEST\blabla.txt

Maybe: WHENEXISTS=replacenewer,merge

(untested)

Change TO to take out the \Test.

Thanks,

I'm just using this:

COPY FILE "M:\TEST*" TO "X:\GRMS01\TEST" COPYDIRTIMES=yes COPYFILETIMES=yes COPYATTR=yes NONBUFIO=yes FORCE UPDATEALL WHENEXISTS=replacenewer

("M:\TEST*" instead of "M:\TEST")

and it works.

If this might not be correct (take out "\Test" might be more correct?) - please let me know.

THANKS

Either is fine.

You want to do either of these:
[ul][li]Copy M:\Test to X:\GRMS01[/li]
[li]Copy everything below M:\Test to X:\GRMS01\Test[/li][/ul]

One command does one, the other does the other. If X:\GRMS01\Test already exists then there isn't much difference between the two. If it may not exist, then you want the one Jon suggested.

Does the wildcard run the risk of exceeding an argument or command line limit?

No, wildcards aren't expanded into huge command lines like with a Linux/Unix shell, if that's what you're thinking of.

I see. Thanks.