By registering with us, you'll be able to discuss, share and exchange private messages with other members of our community.

SignUp Now!

Declined Allow trailing backslash in MOVEDIR args

... especially when the filename completion option "append \ to dir" is set to yes.


MOVEDIR and COPYDIR already support that. Csn you give an ecample of what you are doing that doesn't work?

md .\dir1
touch /c/q .\dir1\file1.tmp
md .\dir2
touch /c/q .\dir2\file2.tmp

:: Works:
movedir .\dir1 .\dir2\

:: Error:
movedir .\dir1\ .\dir2\

Personally, I think the second syntax is clearer. Although one could allow the omission of the final "\" for convenience, I feel it should not be mandatory.
I don't think this is what you really want.

MOVEDIR doesn't want the destination directory to exist. Because your destination directory (dir2) already exists, MOVEDIR will append the last subdirectory name in source to destination, create the new subdirectory, and move source to destination. (See the help for MOVEDIR.)

So if MOVEDIR stripped the trailing \ from the source, you'd end up with "movedir .\dir1\ .\dir2\dir1", which seems unlikely to satisfy you.

If you really want to move the contents of a directory to an existing directory, you should be using the MOVE command.
I would use MOVE to merge, and MOVEDIR to move directory .\dir1 into .\dir2, leaving me with .\dir1\dir2, and be satisfied and say thank you very much.

What am I missing?

Everywhere .\dir is equivalent to .\dir\

I have always thought about it as the first variant being ambiguous; it could be a file without an extension or it could be a directory but we need disk i/o to verify that. On the other hand, the notation .\dir\ can only refer to a directory.

Since we're moving directories here, I would say the second notation is "natural" to the MOVEDIR command and the first could be allowed.
You seem to be saying it should be penalized?

Actually, what I would *really* like is, use MOVE for both operations

MOVE .\dir1 .\dir2
...\dir1\*.* => ...\dir2\dir1\*.*


MOVE .\dir1\ .\dir2
...\dir1\*.* => ...\dir2\dir1\*.*

... since the source describes a directory,
as apposed to:

MOVE .\dir1\*.* .\dir2
...\dir1\*.* => ...\dir2\*.*

... since the source describes files.