I need to copy the files with filenames that have four characters or less and .TMP extension into a folder. Can this be done with one command if they are in one location?
1 Answer
The answer is:
COPY [SOURCE]\????.TMP [DESTINATION]
Where [SOURCE]
is the source drive/folder and [DESTINATION]
is the destination drive/folder.
-
Sorry Im really new at this so hang with me here. When I run dir COPY [SOURCE]\????.TMP [DESTINATION] first its pulling more than four character files names.– OCGIRLCommented Apr 12, 2015 at 22:02
-
@OCGIRL: Don't combine dir and copy obviously, since they are separate commands. Just try
dir [SOURCE]\????.TMP
– KaranCommented Apr 12, 2015 at 22:08 -
lol no I didn't combine copy and dir. I'm new but not that much of a newbie. Thanks again.– OCGIRLCommented Apr 12, 2015 at 22:11
-
@OCGIRL: Your comment above strongly suggested you did combine them, since you used
dir copy ...
, unless you meant that you ran those two commands separately which wasn't at all clear. Anyway, good that you got it to work. Don't forget to thank RockPaperLizard by accepting his answer.– KaranCommented Apr 12, 2015 at 22:23 -
@OCGIRL Glad it worked for you :-) Happy to help. Commented Apr 16, 2015 at 1:43