Copy files recursively ?

Page 1 of 1

11 Replies - 8088 Views - Last Post: 03 December 2007 - 08:02 PM

#1 nav33n   User is offline

  • D.I.C Head

Reputation: 7
  • View blog
  • Posts: 71
  • Joined: 02-October 07

Copy files recursively ?

Posted 16 October 2007 - 05:32 AM

Hi all ! I am not quite sure if this is the right forum to post this topic! but anyway, let me post my question!

I have a folder, pics. In pics, i have some 20 folders with 100's of photos in each folder. I want to copy these photos in 20 folders to a single folder, is it possible ? in dos probably ?

Thanks !
Is This A Good Question/Topic? 0
  • +

Replies To: Copy files recursively ?

#2 Louisda16th   User is offline

  • dream.in.assembly.code
  • member icon

Reputation: 15
  • View blog
  • Posts: 1,967
  • Joined: 03-August 06

Re: Copy files recursively ?

Posted 16 October 2007 - 06:08 AM

This is the wrong forum. You should have posted in Computer support. Wait for a moderator to move it.
Was This Post Helpful? 0
  • +
  • -

#3 Louisda16th   User is offline

  • dream.in.assembly.code
  • member icon

Reputation: 15
  • View blog
  • Posts: 1,967
  • Joined: 03-August 06

Re: Copy files recursively ?

Posted 16 October 2007 - 06:31 AM

You could write one batch file with all your commands and execute it at once. Im not sure if there's any other way. Possibly someone has a better solution.
Hope this helps :).
Was This Post Helpful? 0
  • +
  • -

#4 Liontrue1   User is offline

  • D.I.C Addict
  • member icon

Reputation: 48
  • View blog
  • Posts: 811
  • Joined: 20-May 06

Re: Copy files recursively ?

Posted 16 October 2007 - 09:17 AM

Of course, there are plenty of other ways. You can create a small app (Java, C++, VB...) that does it for you and make it use recursive functions/methods. If you need some code just post in a forum!
Was This Post Helpful? 0
  • +
  • -

#5 Louisda16th   User is offline

  • dream.in.assembly.code
  • member icon

Reputation: 15
  • View blog
  • Posts: 1,967
  • Joined: 03-August 06

Re: Copy files recursively ?

Posted 16 October 2007 - 11:05 AM

Quote

Of course, there are plenty

My Bad. I was under the impression that he was looking for DOS commands.
Was This Post Helpful? 0
  • +
  • -

#6 jjhaag   User is offline

  • me editor am smartastic
  • member icon

Reputation: 49
  • View blog
  • Posts: 1,789
  • Joined: 18-September 07

Re: Copy files recursively ?

Posted 16 October 2007 - 11:13 AM

If all of the folders with the pics are in one single parent directory, you might try this...

For a less technologically-snazzy way, go to search (I'm just assuming this is WinXP). Click search for pictures etc, then click advanced options. Type the path of the parent directory into the "Look in" field, and *.jpg or *.jpeg (again, just assuming here) in the file name field.

The search results will be a list of all the files across all of the directories. Highlight and drag or copy/paste into the new directory.

-jjh
Was This Post Helpful? 0
  • +
  • -

#7 skyhawk133   User is offline

  • Head DIC Head
  • member icon

Reputation: 1981
  • View blog
  • Posts: 20,434
  • Joined: 17-March 01

Re: Copy files recursively ?

Posted 16 October 2007 - 11:15 AM

View Postjjhaag, on 16 Oct, 2007 - 12:13 PM, said:

If all of the folders with the pics are in one single parent directory, you might try this...

For a less technologically-snazzy way, go to search (I'm just assuming this is WinXP). Click search for pictures etc, then click advanced options. Type the path of the parent directory into the "Look in" field, and *.jpg or *.jpeg (again, just assuming here) in the file name field.

The search results will be a list of all the files across all of the directories. Highlight and drag or copy/paste into the new directory.

-jjh


That's the PERFECT way to do that... man, wish I had thought of it :(
Was This Post Helpful? 0
  • +
  • -

#8 Louisda16th   User is offline

  • dream.in.assembly.code
  • member icon

Reputation: 15
  • View blog
  • Posts: 1,967
  • Joined: 03-August 06

Re: Copy files recursively ?

Posted 16 October 2007 - 11:16 AM

Me too :(. Sometimes the most complicated problems have the simplest solutions!! :)
Was This Post Helpful? 0
  • +
  • -

#9 jjhaag   User is offline

  • me editor am smartastic
  • member icon

Reputation: 49
  • View blog
  • Posts: 1,789
  • Joined: 18-September 07

Re: Copy files recursively ?

Posted 16 October 2007 - 11:47 AM

View PostLouisda16th, on 16 Oct, 2007 - 12:16 PM, said:

Me too :(. Sometimes the most complicated problems have the simplest solutions!! :)

Thanks - hope it helps a few of you.

I ftp'ed a bunch of GIS data a while back and needed to get it all organized...I mean, it's fine having to manually go and move a couple of hundred pics, but we're talking about 30000+ tifs, shapefiles, xml metadata files, etc, in maybe 300 different directories, all of them nested. That kind of thing REALLY makes you search for something effective.

-jjh
Was This Post Helpful? 0
  • +
  • -

#10 MorphiusFaydal   User is offline

  • D.I.C Lover
  • member icon

Reputation: 44
  • View blog
  • Posts: 1,376
  • Joined: 12-May 05

Re: Copy files recursively ?

Posted 16 October 2007 - 02:26 PM

It's a one-liner, if you're on a unix box:

cp */* ~/NewPics/



Of course, make sure you've got the NewPics folder already made. Or whatever you want to call it. And you run it from inside the directory that has all the old pics.
Was This Post Helpful? 0
  • +
  • -

#11 nav33n   User is offline

  • D.I.C Head

Reputation: 7
  • View blog
  • Posts: 71
  • Joined: 02-October 07

Re: Copy files recursively ?

Posted 16 October 2007 - 11:21 PM

Wow! :^: thank you all for ur time and response ! Psst..i wasnt thinking of writing a program to do the work for me! but the "searching method" will surely work! thanks again!
Cheers!
Was This Post Helpful? 0
  • +
  • -

#12 teron83xl   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 1
  • Joined: 03-December 07

Re: Copy files recursively ?

Posted 03 December 2007 - 08:02 PM

View Postnav33n, on 16 Oct, 2007 - 11:21 PM, said:

Wow! :^: thank you all for ur time and response ! Psst..i wasnt thinking of writing a program to do the work for me! but the "searching method" will surely work! thanks again!
Cheers!


I do have a dos version (batch file) for this simple task.
I got it from searching 7zip archiving in dos command. And I simplified it to suit the task. The credit should go to the original poster.

@echo off
rem set you folder and target folders here
set _folder_in="D:\source\"
set _folder_out="D:\target\"

rem set the desired extensions inside the bracket like below
for /r %_folder_in% %%g in (*.zip *.rar *.7z) do call :process "%%g"

pause
goto :eof

:process
set _fullfile=%~f1
COPY %_fullfile% %_folder_out%
rem you can modify COPY to other dos commands such as MOVE or DELETE etc.

goto :eof




my 1st post , hope it helps

This post has been edited by teron83xl: 03 December 2007 - 08:04 PM

Was This Post Helpful? 1

Page 1 of 1