Why does MOVE command in DOS treat wildcard patterns oddly in this case?

Posted by Adisak on Super User See other posts from Super User or by Adisak
Published on 2012-08-30T15:58:14Z Indexed on 2012/09/01 9:41 UTC
Read the original article Hit count: 223

Filed under:

I am using the "move" command with a wildcard pattern in the CMD prompt under Windows 7.

In my source directory, I have the following files:

 movie1.avi
 movie1.avi_metadata
 movie2.avi
 movie2.avi_metadata

If I type the command move source\*.avi dest it will move all four files even though I would expect it to only move the two *.avi files and not the *.avi_metadata files.

As expected, move source\*.a dest and move source\*.av dest don't move any files. However when the length of the extension for the wildcard pattern is 3 characters, it will move all extensions that begin with those first three characters.

Is this a bug in the "move" command or expected behavior and is it documented anywhere?


Edit: John Watts notes that this is probably do to "short" filenames.

Is it possible then to make commands in the CMD interpreter only operate on long filenames and to ignore short filenames?

© Super User or respective owner

Related posts about command-line