Page 1 of 1

Search and copy files from particular folder

Posted: 11 Jun 2016 08:53
by zagix
Hi,

I need to copy .pdf's files from particular folder to destination folder.
The folder Root is at C:\Backup and in them multiple sub-folders are there.

C:\Backup --root folder
Database--sub-folder
01012016--sub-folder,sub-folder,sub-folder,sub-folder,IME
02012016--sub-folder,sub-folder,sub-folder,sub-folder,sub-folder,sub-folder,IME
03012016--sub-folder,sub-folder,sub-folder,sub-folder,sub-folder,sub-folder,sub-folder,IME
04012016--sub-folder,sub-folder,sub-folder,sub-folder,sub-folder,sub-folder,sub-folder,sub-folder,sub-folder,IME
05012016--sub-folder,IME

Now selecting only IME folder copy all the .pdf files inside them to C:\IMEPDF

Re: Search and copy files from particular folder

Posted: 11 Jun 2016 09:14
by aGerman
Give that a shot:

Code: Select all

set "root=C:\Backup"
set "dest=C:\IMEPDF"

for /f "delims=" %%i in ('dir /ad /b /s "%root%\IME"') do copy "%%i\*.pdf" "%dest%\"

Regards
aGerman

Re: Search and copy files from particular folder

Posted: 14 Jun 2016 22:59
by foxidrive
zagix wrote:I need to copy .pdf's files from particular folder to destination folder.


zagix, was aGerman's help useful for you?

Re: Search and copy files from particular folder

Posted: 15 Jun 2016 02:51
by zagix
Hi,

Sorry for delay in reply.

Thanks works perfectly.