Copying multiple files in a list, from one folder to another...

Page 2 of 4 FirstFirst 1234 LastLast

  1. Posts : 7
    Windows 7 x64
    Thread Starter
       #11

    Yay!!!!!!!

    Thanks, that worked!!
      My Computer


  2. Posts : 10,485
    W7 Pro SP1 64bit
       #12

    Glad that it worked for you
      My Computer


  3. Posts : 7
    Windows 7 x64
    Thread Starter
       #13

    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.
      My Computer


  4. Posts : 10,485
    W7 Pro SP1 64bit
       #14

    Bummer :-(

    I've sent you a PM so that you can share some file name info that you might not want in a public thread.

    You can use the link in the upper left corner of this web page to get to the PM system:

    Copying multiple files in a list, from one folder to another...-pm.png
      My Computer


  5. Posts : 1
    window 7 professional x64
       #15

    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.
      My Computer


  6. Posts : 10,485
    W7 Pro SP1 64bit
       #16

    rcdev said:
    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.
      My Computer


  7. Posts : 1
    Window 7
       #17

    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!
      My Computer


  8. Posts : 6
    Windows 7 64 bit
       #18

    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!
      My Computer


  9. Posts : 10,485
    W7 Pro SP1 64bit
       #19

    Try this code:
    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 & "\")
    I would suggest that you change this part...
    "C:\temp\"
    ...of this line:
    Code:
    $FileName = FileOpenDialog("Select the file that contains the list of  files to find & copy", "C:\temp\", "Text File (*.txt)")
    to the folder where you will keep the text list of the files to be copied. That should save you some navigation.

    The same is true for this part...
    "c:\temp\s"
    ...of this line:
    Code:
    $SourceFolder = FileSelectFolder("Select the source folder.", "c:\temp\s")
    ...and this part...
    "c:\temp\d"
    ...of this line:
    Code:
    $DestinationFolder = FileSelectFolder("Select the destination folder.", "c:\temp\d")
    You will be changing those last two lines to point to your network resource.
    You can use a mapped drive letters or UNC* paths.

    * \\servername\sharename\folder
      My Computer


  10. Posts : 10,485
    W7 Pro SP1 64bit
       #20

    > 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
      My Computer


 
Page 2 of 4 FirstFirst 1234 LastLast

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 08:43.
Find Us