Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


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

28 May 2014   #1
ealkire

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

I have an excel spreadsheet listing over 300 hundred pictures that I need to send to find.

I know where all these images are located, but the folder they are in has thousands of other photos.

Is there a way for me to easily find the picture on my excel list?


My System SpecsSystem Spec
.
28 May 2014   #2
UsernameIssues

W7 Pro SP1 64bit
 
 

Welcome to the Seven Forums.

What do you want to do with the picture once you find it?

It should be possible to run batch file...
...the batch file reads the Excel list*
...the batch file copies** the photos of interest
...and puts then into a temporary folder on your desktop***.

*assumes that the Excel file can be saved as text (CSV).
**or moves or maybe a few other things
***or a different location/folder

Does that sound like something that would help you?
My System SpecsSystem Spec
29 May 2014   #3
ealkire

Windows 7 x64
 
 

I will just need to email the files or put them on a zip drive to give to someone else.

how do I write a batch file?
My System SpecsSystem Spec
.

29 May 2014   #4
UsernameIssues

W7 Pro SP1 64bit
 
 

So - you are okay with these files being a copy of the original - correct?
(e.g The original photos should stay where they are.)


Are the photos all in one folder?
(c:\photos\...)

Or are they in multiple folders?
(c:\photos\2010\...)
(c:\photos\2011\...)
(c:\photos\2012\...)

If the photos are in multiple folders, can the batch file put the copies into one single folder for you to work with? Or do you need to keep them in the same type of folder structure?


We will work on writing the batch file if I determine that a batch file is going to work best for you :-)
My System SpecsSystem Spec
29 May 2014   #5
ealkire

Windows 7 x64
 
 

yes, a copy of the file is fine. They should all be in one folder, but there might be an instance where they are in different folders.
My System SpecsSystem Spec
29 May 2014   #6
UsernameIssues

W7 Pro SP1 64bit
 
 

Okay - it is important that what I come up with works for every case that you will encounter.

Sorry to keep asking questions...
Can you save the spreadsheet as text so that it looks like this in notepad:
[Within Excel, save the list of files as Text (MS-DOS)(*.txt).]
photo1.jpg
photo33.jpg
photo88.jpg

It sort of* does not matter what the file names are.

*Are the file names simple letters/numbers?
No special characters?


The end goal of using a batch file or a script is:
You create the text file that lists the photos to be found.
You run the batch file or script.
You will have a copy of all of the files of interest in a temp folder within seconds.
My System SpecsSystem Spec
29 May 2014   #7
ealkire

Windows 7 x64
 
 

Yes, I can make the spreadsheet a txt.

File names are just letters and numbers. no spaces.
My System SpecsSystem Spec
29 May 2014   #8
UsernameIssues

W7 Pro SP1 64bit
 
 

Is this on a work computer? If so, can you install AutoIt?

Don't install it. I'm just asking if such is allowed.
My System SpecsSystem Spec
29 May 2014   #9
ealkire

Windows 7 x64
 
 

Yes, It's a work computer, but I can download programs.
My System SpecsSystem Spec
29 May 2014   #10
UsernameIssues

W7 Pro SP1 64bit
 
 

Please watch these videos and see if this script is something that you can use:

You might want to watch in the full screen mode and at 720p.


The script only looks in one folder. If the script cannot locate one of the files, it pops up a box for you to copy the file name and paste it into the search box as shown in the video below.

There is a way to make the script search each folder, but since you said that does not happen very often, I kept the script simple.

If you want to try this script, then install AutoIt from here: AutoIt Downloads - AutoItScript
Copying multiple files in a list, from one folder to another...-autoit-dl.png
Accept the default settings during the installation.
Then close the help file.
The installer does not install extra junk programs :-)

After the installation completes...
...click on an empty spot on your desktop
...press F5 to refresh the desktop
(so that the Explorer's context menu updates)
...right click on an empty spot on your desktop
...and select New > AutoIt v3 Script as shown in the first video
(if AutoIt v3 Script is not shown in the context menu, restart the computer)
...name the newly created file whatever you want
...right click on that newly created file
...and select Edit Script from the context menu
...copy the code in the code box below and paste it into that file
...close/save the file.

The video shows right clicking on the file and selecting Run Script. You can just double click to run the script.


If the script ever hangs - you can kill it by clicking on the AutoIt icon down by the clock and selecting Exit.
Code:
Opt("TrayIconDebug", 1)

$S_running = "find-copy-photos" ;name the script
If WinExists($S_running) Then
    MsgBox(0, "AutoIt", "The script to find and copy photos is already running")
    Exit
EndIf
AutoItWinSetTitle($S_running)

$FileName = FileOpenDialog("Select the file that contains the list of photos to find & copy", "C:\temp\", "Text File (*.txt)")
If @error Then Exit

$FileNameArray = StringSplit(FileRead($FileName), @CRLF, 1)

$PhotoFolder = FileSelectFolder("Select the top level folder that contains the photos.", "")
If @error Then Exit

$search = FileFindFirstFile($PhotoFolder & "\*.*")
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($PhotoFolder & "\" & $file, @DesktopDir & "\output\", 8)
            $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 " & @DesktopDir & "\output\")


My System SpecsSystem Spec
Reply

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




Thread Tools Search this Thread
Search this Thread:

Advanced Search




Similar help and support threads
Thread Forum
select/search multiple files from a list, copy and paste to new folder
I have a list of 1000 files names (photo files) from clients and need to find them in one folder which has 10000+ files in it.And my clients files list do not have the full photo name (only a part of file name, eg: the file name in my local disk is "403817-QTX0022-30763812_Q10Photo.jpeg" and name...
General Discussion
Missing files after copying folder to another drive
Hello all, I'm running a genuine copy of Windows 7 Ultimate. I just completed a fresh install (with MS's help) and now I'm reinstalling all my files and programs. I have copied the "My Documents" folder from a backup drive to another drive. However, I noticed that in the source drive there are...
General Discussion
How to copy multiple .wma files in different folders to single folder?
I need to 'extract' .wma files from within many different folders to a single, main folder. It looks like this: Main Folder>Artist>Album>Track (.wma) but there are many artists. I want to get all the tracks from within the two subfolders into a single folder. I've searched around online and haven't...
Music, Pictures & Video
Copying files into "Windows/System" folder used by XP Mode
Hello Everyone, I am working in Win7 XP Mode, trying to install and run a Microsoft utility called: WT1230: Batch File Converter for PowerPoint for Windows 95 (see WT1230: Batch File Converter for PowerPoint for Windows 95 ) Yes, the utility is intended for Win95, but I'd like to see if...
Virtualization
List Files in Folder With Ignore List
Edit: Sorry I made the topic an forgot to change the title. Should be: "List Files in Folder With Ignore List" or something along those lines. I'm a game server admin. What I want to do is generate a text file which will be used when I launch the server. An example of the text file I want to...
General Discussion
Copying Files Within Source Folder
This is something small, but kinda annoying for me. In XP, if I copied and pasted a file within the same folder, the file name would be "copy of file.ext". this was great for me cause I could easily sort the files by name and then move them to the final destination folder. But now in Win7, the...
General Discussion


Our Sites

Site Links

About Us

Find 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 16:30.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App