We help IT Professionals succeed at work.

Copy files that begin with specific letters and numbers and then copy them out once found

I would like to search a folder, for example C:\Attachement\Inbox..  for any files that start with the  following  INBOUND123..... .in  
then I could like to copy if found to another folder called C:\Attachments\Transferred..

What batch command can I use to do this?
Comment
Watch Question

David Johnson, CDSimple Geek from the '70s
Distinguished Expert 2019

Commented:
robocopy C:\Attachement\Inbox\INBOUND123* C:\Attachments\Transferred

Open in new window

copy C:\Attachement\Inbox\INBOUND123* C:\Attachments\Transferred

Open in new window

xcopy C:\Attachement\Inbox\INBOUND123* C:\Attachments\Transferred

Open in new window

Test your restores, not your backups...
Expert of the Year 2019
Top Expert 2016
Commented:
Hard to tell from the question text, but if you need the extension IN, then just add it, like:

copy "C:\Attachement\Inbox\INBOUND123*.in" "C:\Attachments\Transferred"

Open in new window


»bp