copy files from multiple folders

September 14, 2010 at 07:48:56
Specs: Windows XP
I have many folder e.g
cr97821
cr97836
cr97840
cr97849
cr97867

and in all folder have one zip file. so i want to copy all zip file in one folder.
Please tell me any command for that.

Rohit


See More: copy files from multiple folders

Report •

#1
September 14, 2010 at 08:00:21
We will use bat script but please PUT THIS TOPIC IN PROGRAMMING!!


@echo off
REM By rediwed
REM this part will copy all files to c:\tempfolder\

cd <Path>\cr97821
xcopy *.* c:\tempfolder\
cd <Path>\cr97836
xcopy *.* c:\tempfolder\
cd <Path>\cr97840
xcopy *.* c:\tempfolder\
cd <Path>\cr97849
xcopy *.* c:\tempfolder\
cd <Path>\cr97867
xcopy *.* c:\tempfolder\

untested!
hope it works


Report •

#2
September 14, 2010 at 11:49:49
To save the tedium of typing out each directory - you can use this. Just change the first cd line to point to the root where all the sequentially named folders are located and change the copy to location.

@echo off
cd driveletter:\root of folder list
for /f "delims=|" %%a in ('dir /b /s *.zip') do (
copy "%%a" c:\temp
)


Report •

#3
September 14, 2010 at 20:26:40
Hi Rediwed.

Thanks for suggestion but its not working...

see this is my path
H:\roh\Job\done\com and in this path i kept 5 zip files .. like

cr97821.zip
cr97836.zip
cr97840.zip
cr97849.zip
cr97867.zip

when i used
copy H:\roh\Job\done\com\cr97968\*.zip H:\roh\Job\done\com
it is working..but it is taken long time for each file .......... but i want any other command to copy all files at a time.

Regards,
rohit


Report •
Related Solutions


Ask Question