New
#11
Yay!!!!!!!
Thanks, that worked!!
Glad that it worked for you
Hi,
I tried doing another list of photos, and it didnt work for a few pictures.
I know for sure that the photos are in the folder I was searching (because i was doing this as a sort of test), but it came up with a box that said "could not find..."
any idea why it would do that?
It found other photos in the folder, but couldn't find some of them.
Great! this works for me too. How about if I wanna find photos under a subfolder? for example, main folder is "Photomain" and I have subfolder "photosub". My list includes photo names for both main and sub folder.
Sorry for the late reply.
Having all of the photos in one folder handles the issue of duplicate file names.
e.g. there might have files in these paths on the hard drive:
...\photomain\image12.png
...\photomain\photosub\image58.png
...\photomain\photosub2\image58.png
If your list of files to copy included image58.png, should the script just silently copy the first match found or warn you that two or more files were found with the name image58.png? If image58.png is the same photo that is stored in two locations, then copying the first one found is not a problem. But, if the images are different and you really meant to copy the file located in subfolder2, then copying the first file found is a problem.
And then there is the recursion level: How many sub-folder levels should be searched? 2? 30?
It is possible to include sub-folders in the search/copy script, but it would take me too long to write/debug such code. If you still need a script that will handle sub-folders, then you can join AutoIt's forum and ask for help with creating such a script. But be warned, I've seen members of that forum be rude to newcomers. (Rude as in cursing, name calling, belittling ...) Your experience might vary.
Hi RCDEV,
Did you find a way to search sub folders?
It would save me a lot of time if it was possible to search in sub folders.
I tried to look into the Microit forum but it's all giberous to me!!! Help!
UsernameIssues I like the Autoit software you recommended but i am having problems editing the scrip to work for my needs and wonder if you could help?
I'm not moving photos, I need to copy file from a large master list into a separate folder. The source files are on our work network. I have created a .txt list but the scrip is giving me fits. I would like the scrip to ask me for a list and source location of files and a destination for the files. The list will be local (desktop) and the source and destination would be network location.
Thanks for anyhelp at all!
Try this code:
I would suggest that you change this part...Code:Opt("TrayIconDebug", 1) $S_running = "find-&-copy-files" ;name the script If WinExists($S_running) Then MsgBox(0, "AutoIt", "The script to find & copy files is already running") Exit EndIf AutoItWinSetTitle($S_running) $FileName = FileOpenDialog("Select the file that contains the list of files to find & copy", "C:\temp\", "Text File (*.txt)") If @error Then Exit $FileNameArray = StringSplit(FileRead($FileName), @CRLF, 1) $SourceFolder = FileSelectFolder("Select the source folder.", "c:\temp\s") If @error Then Exit $DestinationFolder = FileSelectFolder("Select the destination folder.", "c:\temp\d") If @error Then Exit $search = FileFindFirstFile($SourceFolder & "\*.*") If $search = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern") Exit EndIf While 1 Local $file = FileFindNextFile($search) If @error Then ExitLoop For $i = 1 To $FileNameArray[0] If $file = $FileNameArray[$i] Then FileCopy($SourceFolder & "\" & $file, $DestinationFolder & "\") $FileNameArray[$i] = "" EndIf Next WEnd For $i = 1 To $FileNameArray[0] If $FileNameArray[$i] <> "" Then InputBox("Error", "Could not find:", $FileNameArray[$i]) If @error = 1 Then Exit EndIf Next Run("explorer.exe " & $DestinationFolder & "\")
"C:\temp\"
...of this line:
to the folder where you will keep the text list of the files to be copied. That should save you some navigation.Code:$FileName = FileOpenDialog("Select the file that contains the list of files to find & copy", "C:\temp\", "Text File (*.txt)")
The same is true for this part...
"c:\temp\s"
...of this line:
...and this part...Code:$SourceFolder = FileSelectFolder("Select the source folder.", "c:\temp\s")
"c:\temp\d"
...of this line:
You will be changing those last two lines to point to your network resource.Code:$DestinationFolder = FileSelectFolder("Select the destination folder.", "c:\temp\d")
You can use a mapped drive letters or UNC* paths.
* \\servername\sharename\folder
> I need to copy file from a large master list...
Is that large master list in an Excel spreadsheet?
If so, how are you currently making the TXT file to be used with the script?
Last edited by UsernameIssues; 12 Sep 2016 at 04:23. Reason: typo