File Search and copy

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
madness
Posts: 2
Joined: 29 May 2013 14:57

File Search and copy

#1 Post by madness » 29 May 2013 15:28

Hi my name is alan and im new to most things in dos.

I have wrote a few simple xcopy batch files and they work nicely.

I am wondering if it is possible to search a folder which contains thousands of files knowing only a partial bit of the file name and if found copy these files to another folder.

The file names start like this: 130515 this is the start of the file name and represents the year month and date the file was created.

The files are .mp4 files and are approximately 10 numbers in length and end with a number from 1 to 9.

Is it possible to create a batch file to search based on the first first 6 numbers of the file name and the last number of the file name and then copy all files that match to a specified folder.

Sample file name 1305120315641.mp4


Thanking You in advance

Alan :?:

Endoro
Posts: 244
Joined: 27 Mar 2013 01:29
Location: Bozen

Re: File Search and copy

#2 Post by Endoro » 29 May 2013 16:11

I don't know exactly what you mean. In a set of files

Code: Select all

1305120315641.mp4
1305120315642.mp4
1305130315641.mp4
1305130315642.mp4

this works:

Code: Select all

C:\TEST>dir /b 130512*1.mp4
1305120315641.mp4

madness
Posts: 2
Joined: 29 May 2013 14:57

Re: File Search and copy

#3 Post by madness » 31 May 2013 11:09

Cheers man haven't test yet as have been away from oc.

Thanks for your help

Alan

Post Reply