Solved How to use move command to move specific files?

September 6, 2014 at 10:18:47
Specs: Windows 7

Im aware how to use commands like move "a" *.gif to move any gif file starting with an "a". How can I use similar commands like moving gif files that end in "12", "asd" or any other similar variation?

See More: How to use move command to move specific files?

Report •

✔ Best Answer
September 6, 2014 at 23:59:46
Yeah, ? is a wildcard for any character.

Offhand I'm not sure if, for example, using wildcards for a 5 character file name--?????.jpg--will also respond to file names with less than 5 characters. You may need to experiment with that. I usually use the COPY command rather than MOVE but I think both use the same rules.

Don't forget to preorder your Hatch green chili for this fall. Many vendors ship world-wide. Better hurry. They're picking and shipping now.



#1
September 6, 2014 at 11:16:56
Are you doing this from a command prompt? Creating a batch file? More information would be helpful.

Report •

#2
September 6, 2014 at 14:05:56
Try move *asd.gif for gif file names that for example end in asd. That seems to work in xp command prompt.

Don't forget to preorder your Hatch green chili for this fall. Many vendors ship world-wide. Better hurry. They're picking and shipping now.


Report •

#3
September 6, 2014 at 19:08:24
Yes its all in command prompt

Report •

Related Solutions

#4
September 6, 2014 at 19:12:23
Thanks, that worked great. One last question. Is there a command that would move a file only depending on how many characters that file name has?

Eg: move only files with 4 characers such as :asdf.gif, a324.jpg and dont move 234.gif, 22.bmp.

message edited by ssnader


Report •

#5
September 6, 2014 at 20:18:44
Try ????.gif or ????.jpg

? = position with any character


Report •

#6
September 6, 2014 at 23:59:46
✔ Best Answer
Yeah, ? is a wildcard for any character.

Offhand I'm not sure if, for example, using wildcards for a 5 character file name--?????.jpg--will also respond to file names with less than 5 characters. You may need to experiment with that. I usually use the COPY command rather than MOVE but I think both use the same rules.

Don't forget to preorder your Hatch green chili for this fall. Many vendors ship world-wide. Better hurry. They're picking and shipping now.


Report •

#7
September 7, 2014 at 20:34:18
> dir ????.jpg will show you the result

Report •

#8
September 8, 2014 at 11:36:32
Yep, it does move files that have less characters even if I i type a specific number of ???s, but its good enough. Thankyou all for your help.

Report •

#9
September 8, 2014 at 12:36:19
You're welcome. We're glad it's working out.

Don't forget to preorder your Hatch green chili for this fall. Many vendors ship world-wide. Better hurry. They're picking and shipping now.


Report •

#10
September 8, 2014 at 14:56:28
> Yep, it does move files that have less characters even if I i type a
> specific number of ???s, but its good enough.

I expect that to do what you want, you work from shortest file name
to longest, first moving ?.* to one folder, then ??.* to another folder,
then ???.* to a third folder, and so on.

-- Jeff, in Minneapolis


Report •

Ask Question