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
    What research have you done? Have you tried anything? – CharlieRB Apr 12 '15 at 21:44

The answer is:


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. – OCGIRL Apr 12 '15 at 22:02
  • @OCGIRL: Don't combine dir and copy obviously, since they are separate commands. Just try dir [SOURCE]\????.TMP – Karan Apr 12 '15 at 22:08
  • lol no I didn't combine copy and dir. I'm new but not that much of a newbie. Thanks again. – OCGIRL Apr 12 '15 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. – Karan Apr 12 '15 at 22:23
  • @OCGIRL Glad it worked for you :-) Happy to help. – RockPaperLz- Mask it or Casket Apr 16 '15 at 1:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.