Stickies
« Copy files without folder structure »

Welcome Guest. Please Login or Register.
Aug 20th, 2014, 11:19pm


Click to go to the
Zhorn Software Web Site
Click to go to the
Knowledgebase

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Copy files without folder structure  (Read 7009 times)
John Smith
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 118
xx Copy files without folder structure
« Thread started on: May 26th, 2010, 08:27am »

I have run into the limitation that Windows 7 Libraries can hold only 50 folders. I now have 54 folders containing pictures of my days out and country walks. I wanted to use a library as the source of pictures for slide show wallpaper.

I could of course create a huge job file which has an entry for each folder and all with the same destination. I would though then have to add each new folder as it is created.

Can I create something that will take all the individual files from a variety of folders and copy them in one go into a single folder. This would then be the source of my wallpaper pictures.
User IP Logged

John Smith
JohnPap
Cardinal Member
ImageImageImageImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 513
xx Re: Copy files without folder structure
« Reply #1 on: May 26th, 2010, 9:25pm »

on May 26th, 2010, 08:27am, John Smith wrote:
...
Can I create something that will take all the individual files from a variety of folders and copy them in one go into a single folder. This would then be the source of my wallpaper pictures.

Hello John Smith,

If I understand you correctly, you want to copy all files contained in several different folders into one single target folder.

This translates to, say, the following Bart tasks:

Source: C:\Collection\Folder1\
Target: C:\AllCollections\

Source: C:\Collection\Folder2\
Target: C:\AllCollections\

Source: C:\Collection\Folder3\
Target: C:\AllCollections\

Although the tasks above would seem quite logical, the result would not be the one you desire.

Bart is a tool that synchronizes the target according to the source.

This means that the first task would result in the target folder containing everything in Folder1.

The second task though would copy everything from Folder2 to the target folder but would also delete everything in the target folder that doesn't also exist in Folder2.

The third task would copy everything from Folder3 to the target folder but would also delete everything in the target folder that doesn't also exist in Folder3.

Now that you know how Bart works, maybe you can come up with a trick or something that will help you.

Regards,
John

PS: It has been a very bad day at work... somebody please correct me if I am wrong!
User IP Logged

John Smith
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 118
xx Re: Copy files without folder structure
« Reply #2 on: May 27th, 2010, 01:33am »

Thanks John. You have described my question exactly. I was aware of the problems you list and that's why I asked the question.

It probably means that Bart won't be part of the solution but one of the nice things about this forum is that people are often able to suggest other lines of investigation.
User IP Logged

John Smith
JohnPap
Cardinal Member
ImageImageImageImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 513
xx Re: Copy files without folder structure
« Reply #3 on: May 27th, 2010, 09:49am »

Hello JS,

I will suggest a solution that involves the use of WinZip and provided that there are no matching filenames in all of your source folders.

I will base the steps on the example I gave you in my previous post.

1. Using Windows Explorer, select Folder1, Folder2 and Folder3. Depending on how your folders are organized, you could also select just 'Collection' instead of each an every folder contained in Collection.

2. Right-click on any of the selected folders and from the pop-up menu select 'WinZip' and then 'Add to Zip file...'.

3. Enter a filename for the archive, say 'foo.zip' for example, and click 'Add'.

4. Terminate WinZip.

5. Right-click on 'foo.zip' and from the pop-up menu select 'WinZip' and then 'Extract to...'.

6. Make sure you extract to the 'AllCollections' folder and that the 'Use folder names' checkbox is NOT checked.

7. Click 'Extract' and there you go!

All of your files should exist in the target folder and in case anything goes wrong, you also have a nice backup of your pictures. smiley

I hope that helps.

Regards,
John
« Last Edit: May 27th, 2010, 09:53am by JohnPap » User IP Logged

John Smith
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 118
xx Re: Copy files without folder structure
« Reply #4 on: May 27th, 2010, 12:21pm »

Thank you very much. Everything looked right and should have provided the desired result. Your logic is excellent and I tried it straight away.

I am using Winzip 14.5 and no matter whether the option to Use Folder Names is selected or not, it still extracts the folders with the pictures inside them, rather than extracting just the contents of the folders.

We shouldn't take up the Bart forums room with a Winzip problem so I shall do some searching for how to make Winzip comply with the Use Folder Names option. In the meantime, Thanks again for some elegant sideways thinking.
User IP Logged

John Smith
John Smith
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 118
xx Re: Copy files without folder structure
« Reply #5 on: May 27th, 2010, 12:48pm »

John, I just knew what you were advising should work, it was so logical. I uninstalled Winzip 14.5 and installed an old copy of version 12.1

You are ahead of me I know, it worked just as you said. Many thanks for a solution.
User IP Logged

John Smith
JohnPap
Cardinal Member
ImageImageImageImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 513
xx Re: Copy files without folder structure
« Reply #6 on: May 27th, 2010, 7:40pm »

You're very welcome. smiley

Regards,
John
User IP Logged

Tom Revell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 3032
xx Re: Copy files without folder structure
« Reply #7 on: May 31st, 2010, 09:32am »

You could also try checking the Bart option "Safe Mode" for each task - that will merge the target folders. It's not really what Bart was designed for though, so it's probably not the best way to achieve what you want.

If the number of folders will change, perhaps look at using batch files to do this. With a few foreach loops, one for folders, and one for files, you could get this done.

Alternately, try robocopy. I'm no expert on that app, so perhaps it can't help, but I do know it's hugely capable.

Tom
User IP Logged

John Smith
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 118
xx Re: Copy files without folder structure
« Reply #8 on: May 31st, 2010, 11:12am »

Tom, Thanks very much for your suggestions. I did sort of feel that Bart would not be the answer but reckoned that if it didn't, I would still get some sensible help from this forum.

JohnPap's suggestion to use Winzip has done the job. Once all the pictures from many folders were copied into one huge source folder for the wallpaper, maintenance is quite simple. After each new folder is created I simply have to copy that one new folder across.

Thanks to you both and thanks to the forum. I just need to make sure that I use Bart to backup that big folder - I really don't want to lose it now!
User IP Logged

John Smith
John Smith
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 118
xx Re: Copy files without folder structure
« Reply #9 on: Sep 15th, 2010, 06:33am »

Just a courtesy follow up, if you are interested, to this slightly off topic exchange: after occasional bouts of searching I found the exact answer to my objective, copying all the pictures from various folders into one large folder to be used by Windows 7 as a source for wallpaper backgrounds. The solution was found here -

http://commerce-server-guy.blogspot.com/2008/12/tree-to-flat-copy-using-xcopy.html

and slightly modified by me to add a couple of switches to produce -

dir "C:\Users\John\Pictures\Days Out" /Acheesy /B /S > tempListOfDirs.txt
For /F "tokens=*" %%A IN (tempListOfDirs.txt) Do (
If Exist %%A* (
XCOPY "%%A\*.jpg" "C:\Users\John\Pictures\wallpaper copies" /D /K /Y /R
)
)
del tempListOfDirs.txt

I repeat the sequence for other source folders and now have some 1600 pictures as wallpaper and of course can update them when I add more folders with a single batch file.
User IP Logged

John Smith
John Smith
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 118
xx Re: Copy files without folder structure
« Reply #10 on: Sep 15th, 2010, 06:36am »

The switches in that first line of the batch file should be /Acheesy /B /S

I don't where that smiley thing came from.
User IP Logged

John Smith
John Smith
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 118
xx Re: Copy files without folder structure
« Reply #11 on: Sep 15th, 2010, 06:39am »

I won't be beaten. OK, one bit at a time:

/A then a colon and D, all without spaces, then space /B another space and /S

Just seen the Disable Smileys button so hopefullt this will work: /A:D /B /S
User IP Logged

John Smith
JohnPap
Cardinal Member
ImageImageImageImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 513
xx Re: Copy files without folder structure
« Reply #12 on: Sep 16th, 2010, 11:06am »

Thanks for the info. smiley

Good old DOS and batch files!!!

Now that I come to think of it, I guess that Windows PowerShell could also do the job for you.

In case anyone is interested in PowerShell I happen to have a manual for it (some 300+ pages if I remember well). All you need to do is ask... wink

Regards,
John
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls