If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Rate Thread | Display Modes |
#1
|
|||
|
|||
.BAT File To Copy Files from Many Subdirs Into Single Dir?
Thousands of photos - all in subdirectories like "2010 04-06 Easter At
Angela's" I want to copy all photos into a single directory/share so they are visible in a totally-flat file structure. Reason: I have a Tivo-on-Steroids home media app that has a "SlideShow" feature and it's randomizing algorithm seems flawed somehow and I am hoping that copying everything into a flat file will remedy that. -- Pete Cresswell |
Ads |
#2
|
|||
|
|||
.BAT File To Copy Files from Many Subdirs Into Single Dir?
"(PeteCresswell)" wrote in message
... Thousands of photos - all in subdirectories like "2010 04-06 Easter At Angela's" I want to copy all photos into a single directory/share so they are visible in a totally-flat file structure. Reason: I have a Tivo-on-Steroids home media app that has a "SlideShow" feature and it's randomizing algorithm seems flawed somehow and I am hoping that copying everything into a flat file will remedy that. So are do the files in all the various folders have names that are completely unique, or will there be any duplication between a file in folder A and the same filename in folder B? Assuming that there are no duplicates, are all files named in folder order (eg files 1-10 in folder A, 11-20 in folder B etc). In other words, if you create this flat structure, will all the files that were in one folder still be grouped together (by virtue of having consecutive filenames) afterwards? Or does none of this matter if you want the T-o-S to randomise the order or displaying photos? |
#3
|
|||
|
|||
.BAT File To Copy Files from Many Subdirs Into Single Dir?
Easy
Get "Everything". free to use. Set it up (Tools\Options\NTFS etc) to look at all drives and wait for it to complete. You will have a list of all files on those selected drives. Filter for *.jpg *.bmp or whatever. Select all files you want to copy. Right-click to copy, the mouse to the destination and click Paste. Everything will then update and show the new folder with all files. So next time just sort on path and select by that sorted portion. The new Everything sorts quickly. |
#4
|
|||
|
|||
.BAT File To Copy Files from Many Subdirs Into Single Dir?
Per NY:
So are do the files in all the various folders have names that are completely unique, or will there be any duplication between a file in folder A and the same filename in folder B? Totally unique. Assuming that there are no duplicates, are all files named in folder order (eg files 1-10 in folder A, 11-20 in folder B etc). No. In other words, if you create this flat structure, will all the files that were in one folder still be grouped together (by virtue of having consecutive filenames) afterwards? No, but it does not matter bco the randomized presentation. The original copies will still exist in their folders - this will strictly be a sort of "Temp" area for the benefit of the T-o-S app. My plan would be to, every so often, wipe the area clean and simply re-copy into it. I'm thinking something around iterating directories and recursing through them, but my knowledge of .BAT syntax is rudimentary at best. -- Pete Cresswell |
#5
|
|||
|
|||
.BAT File To Copy Files from Many Subdirs Into Single Dir?
On 11/09/2017 12:05 PM, (PeteCresswell) wrote:
Thousands of photos - all in subdirectories like "2010 04-06 Easter At Angela's" I want to copy all photos into a single directory/share so they are visible in a totally-flat file structure. Reason: I have a Tivo-on-Steroids home media app that has a "SlideShow" feature and it's randomizing algorithm seems flawed somehow and I am hoping that copying everything into a flat file will remedy that. Make a text file with like notepad and call it something you understand like: duplicate.bat Then edit it (don't launch it). Add lines like: copy sourcedir\*.* destinationdir this will copy all files from source to destination. Sample like copy c:\folder1\folder2\*.* D:\mediafolder then do another line like copy C:\folder1\folder3\*.* D:\mediafolder this will again copy the 2nd folder (3) to your mediafolder keep doing lines like this till every folder and every file is copied. as a matter of fact you could even clear the folder first by adding this line at the beginning: del D:\mediafolder\*.* which will purge the media folder before the next lines will copy files. Once you've done all the edits just save it and then if you double click it, it will run and do what you type. Just be aware that you type it right. Especially the del command. It will delete files even if you put the wrong folder. Many a system has been corrupted by doing bad commands. Make a system image if you would feel more safe. .... don't hold me responsible for errors. It's your validation to check... |
#6
|
|||
|
|||
.BAT File To Copy Files from Many Subdirs Into Single Dir?
On 11/09/2017 09:05 AM, (PeteCresswell) wrote:
Thousands of photos - all in subdirectories like "2010 04-06 Easter At Angela's" I want to copy all photos into a single directory/share so they are visible in a totally-flat file structure. Reason: I have a Tivo-on-Steroids home media app that has a "SlideShow" feature and it's randomizing algorithm seems flawed somehow and I am hoping that copying everything into a flat file will remedy that. Hi Pete, You would iterate with the "find" command. -T |
#7
|
|||
|
|||
.BAT File To Copy Files from Many Subdirs Into Single Dir?
On 11/09/2017 11:20 AM, T wrote:
On 11/09/2017 09:05 AM, (PeteCresswell) wrote: Thousands of photos - all in subdirectories like "2010 04-06 Easter At Angela's" I want to copy all photos into a single directory/share so they are visible in a totally-flat file structure. Reason: I have a Tivo-on-Steroids home media app that has a "SlideShow" feature and it's randomizing algorithm seems flawed somehow and I am hoping that copying everything into a flat file will remedy that. Hi Pete, You would iterate with the "find" command. -T And it is a complete and total pain in the ass to figure out. If you are still interested, I can see if I have any examples kicking around. |
#8
|
|||
|
|||
.BAT File To Copy Files from Many Subdirs Into Single Dir?
"(PeteCresswell)" wrote
| I want to copy all photos into a single directory/share so they are | visible in a totally-flat file structure. | Here's a VBScript version. Save as .vbs file, edit the two paths to suit. This assumes no going into subfolders. That can also be done but would require a slightly different script. As written this goes through all subfolders in sFol1 and copies all files in the top level of those folders to sFol2. It would be easy to also do things like file extension filter or counter if you need those. '-----------begin script------------- Dim oFol, oFols, oFils, oFol1, sFol1, sFol2, FSO, oFil Set FSO = CreateObject("Scripting.FileSystemObject") sFol1 = "D:\photos" 'source parent folder. sFol2 = "D:\Backup" 'destination folder. On Error Resume Next Set oFol1 = FSO.GetFolder(sFol1) Set oFols = oFol1.SubFolders For Each oFol in oFols Set oFils = oFol.Files For Each oFil in oFils FSO.CopyFile oFil.path, sFol2 & "\" & oFil.name, True Next Set oFils = Nothing Next Set oFols = Nothing Set oFol1 = Nothing Set FSO = Nothing Msgbox "Done." |
#9
|
|||
|
|||
.BAT File To Copy Files from Many Subdirs Into Single Dir?
On 9-11-2017 18:05, (PeteCresswell) wrote:
Thousands of photos - all in subdirectories like "2010 04-06 Easter At Angela's" I want to copy all photos into a single directory/share so they are visible in a totally-flat file structure. Reason: I have a Tivo-on-Steroids home media app that has a "SlideShow" feature and it's randomizing algorithm seems flawed somehow and I am hoping that copying everything into a flat file will remedy that. The way I have done that: In a cmd window go to the directory containing your tree. Then type : dir /b/s *.* a.bat Get the a.bat in a text editer(I use notepad++) remove all lines you dont want(dirs et.), Then do a wildcard change of for example "C:" into "copy c:" Then run the batch file inside the directory where you want them. |
#10
|
|||
|
|||
.BAT File To Copy Files from Many Subdirs Into Single Dir?
On 9-11-2017 18:05, (PeteCresswell) wrote:
Thousands of photos - all in subdirectories like "2010 04-06 Easter At Angela's" I want to copy all photos into a single directory/share so they are visible in a totally-flat file structure. Reason: I have a Tivo-on-Steroids home media app that has a "SlideShow" feature and it's randomizing algorithm seems flawed somehow and I am hoping that copying everything into a flat file will remedy that. If you use the sjideshow option of IFRANVIEW , that produces a nice slideshow,fullscrren if you want to. You can save the filelist for later use. |
#11
|
|||
|
|||
.BAT File To Copy Files from Many Subdirs Into Single Dir?
Puddintane wrote:
Easy Get "Everything". free to use. Set it up (Tools\Options\NTFS etc) to look at all drives and wait for it to complete. You will have a list of all files on those selected drives. Filter for *.jpg *.bmp or whatever. Select all files you want to copy. Right-click to copy, the mouse to the destination and click Paste. Everything will then update and show the new folder with all files. So next time just sort on path and select by that sorted portion. The new Everything sorts quickly. In other words, it doesn't have to be a .bat file. You can use the output pane of a Search window, wipe over the selections you want, copy and paste. For example, if I search using the search in the upper right corner, for ext:jpg then the search pane will contain every JPG on that volume. (Assumes I was viewing the top level of C: at the time.) If I make a compound search ext:jpg AND filename:angela maybe I can select a subset of them. Then, it's just a matter of settling on a search package you like. Windows Search, Agent Ransack, VoidTools Everything.exe and learning their search language. Windows Search can miss stuff, depending on whether a volume is fully indexed or not. The other two are less likely to miss stuff. Only disk areas marked "Access Denied" are going to be a real limitation, and your photos aren't likely to be in C:\System Volume Information :-) With the Windows Search, you can search on the metadata, like maybe ext:jpg AND camera:Nikon AND width:1920 HTH, Paul |
#12
|
|||
|
|||
.BAT File To Copy Files from Many Subdirs Into Single Dir?
On 09/11/2017 17:05, (PeteCresswell) wrote:
Reason: I have a Tivo-on-Steroids home media app that has a "SlideShow" feature and it's randomizing algorithm seems flawed somehow and I am hoping that copying everything into a flat file will remedy that. Would an HTML page be of use? www.macfh.co.uk/Temp/SlideShow.html?I=5000 .... which uses a script file ... www.macfh.co.uk/Temp/General.js The HTML page is self-documented. Here is the General.js documentation: http://www.macfh.co.uk/JavaJive/Prog...b/General.html You could generate the file names to insert by something like ... cd parentfolder dir /b /s *.jpg dir.txt .... and then copying the names out of dir.txt into the source of the html page to replace the demonstration pics within it. However, note that each name must be enclosed in quotes, and all lines containing filenames except the last must end in a comma, as demoed in the existing HTML source. The default time interval is 3 mins, but this can be changed by editing the source, or appending a parameter ?I=interval in milliseconds, as in the above URL. |
#13
|
|||
|
|||
.BAT File To Copy Files from Many Subdirs Into Single Dir?
|
#14
|
|||
|
|||
.BAT File To Copy Files from Many Subdirs Into Single Dir?
Per Puddintane:
Get "Everything". free to use. Set it up (Tools\Options\NTFS etc) to look at all drives and wait for it to complete. That did the trick - albeit only one directory deep.... but that was plenty good enough. Stumbled for awhile on the NTFS setup, but once it dawned on me it went OK. Thanks! -- Pete Cresswell |
#15
|
|||
|
|||
.BAT File To Copy Files from Many Subdirs Into Single Dir?
In message ,
"(PeteCresswell)" writes: Per Puddintane: Get "Everything". free to use. Set it up (Tools\Options\NTFS etc) to look at all drives and wait for it to complete. That did the trick - albeit only one directory deep.... but that was plenty good enough. Stumbled for awhile on the NTFS setup, but once it dawned on me it went OK. Thanks! I'm puzzled by the "only one directory deep" comment. (I recently was looking for a scan I'd done around a certain date, but couldn't remember the name I'd given it; I just told Everything to find .jpg , and sorted by date, and found it - at least four directories down from the D: root. -- J. P. Gilliver. UMRA: 1960/1985 MB++G()AL-IS-Ch++(p)Ar@T+H+Sh0!:`)DNAf That's how he [Dr. Who] seems to me. He's always been someone who gets the /Guardian/. There are some parts of the universe where it's harder to get hold of. - Peter Capaldi (then-current incumbent Doctor), RT 2016/11/26-12/2 |
|
Thread Tools | |
Display Modes | Rate This Thread |
|
|