Windows 10: How Do I select multiple files in a folder from a list of file names Solved

Page 1 of 2 12 LastLast
  1.    1 Week Ago #1

    How Do I select multiple files in a folder from a list of file names


    HI,
    I have a folder containing 9,987 .jpg's of which I need to copy about 500 of to a different folder. I have the file names in a .txt file on separate lines as well as in a .csv worksheet. I don't want to find them individually to select/copy them.

    Also, I'm only a little better than the average monkey at manipulating windows beyond the average use.

    Thank you in advance for your help!
    -Rick
      My ComputerSystem Spec

  2.    1 Week Ago #2

    In the tx file write infront of the file name
    copy
    then after it c:\weretogo
    so if it was
    bat.jpg
    it will be

    copy bat.jog c:\myfolder

    you can copy and paste the txt simpler in excel

    then save the file as back.cmd in the folder containing all the files and run it
      My ComputerSystem Spec


  3. Posts : 4,624
    Win10 Home and Pro, Win10 Insider Preview, WinXP Home Premium, Linux Mint
       1 Week Ago #3

    The tried and true methods, there's 3, is one to click the first file in a list, scroll down to the last one desired, hold down the Ctrl key and click the last one, selects all the files between from the first to the last. The second is to hold down the Ctrl key and click individual files in a random order, where not alphabetized. The third is to use Ctrl plus A to select All files in the Folder. Once selected use Ctrl plus C to Copy, Ctrl plus V to Paste to a different location. Or right-click the selections to Copy or Move then Paste.
      My ComputerSystem Spec


  4. Posts : 7,014
    10 Home x64 (1803) (10 Pro on 2nd pc)
       1 Week Ago #4

    Welcome to TenForums @SGTOOL

    The simplest way to use a text file with a filename on each line (such as list.txt) to copy the files to a folder such as C:\Destination is by using this single command in a command prompt:

    FOR /F "delims=" %N in (list.txt) do COPY "%N" C:\Destination

    'for' loops through all the filenames in list.txt
    "delims=" says use the whole of each line as the parameter %N
    the quotes around %N in 'copy "%N"' allows for any filenames that contain spaces
    C:\Destination specifies the folder you want to copy to (it must already exist, create it first if necessary)

    If the text file contains just the file names, then the command has to be run in the folder that contains the files to be copied. To go to that folder, first use the 'change directory' command: CD <full path to the folder>
    eg: CD C:\Source_folder

    If the text file contains the full path and filename on each line, eg:
    C:\Users\Me\Pictures\SourceFiles\Filename.jpg
    ...then the CD step is not needed.

    If the text file is in a different folder, give the full path to it in the FOR command, eg: (C:\Temp\list.txt)
    Last edited by Bree; 1 Week Ago at 19:29. Reason: more explanation
      My ComputersSystem Spec

  5.    1 Week Ago #5

    Thank Bree
    I will try this tomorrow when I get to my office.
    My list.txt is in the source folder and only includes file names, no path.
    Do I create a target folder in the source folder prior?
      My ComputerSystem Spec


  6. Posts : 7,014
    10 Home x64 (1803) (10 Pro on 2nd pc)
       1 Week Ago #6

    SGTOOL said: View Post
    My list.txt is in the source folder and only includes file names, no path.
    Do I create a target folder in the source folder prior?
    Yes, create the target folder first.

    You can create the target folder anywhere you want as long as you use the full path in the FOR command. If you CD into the source folder and you have created the target folder is in the source folder too, then you just need to give its name.

    FOR /F "delims=" %N in (list.txt) do COPY "%N" Target
      My ComputersSystem Spec

  7.    6 Days Ago #7

    Good Morning @Bree,

    I've tried a couple different ways with nothing happening when I run as administrator.
    Here is my configuration:

    SOURCE: C:\Users\admin\OneDrive\Website FESTOOL\Images\TTS_MAM Low Res\Festool_Picture_Online_Zoom_04_2018

    LIST: List.txt (which is in source folder)

    CODE: Copy_Code.bat (which is in source folder)

    TARGET FOLDER NAMED: Target (which is in source folder)

    See image below.

    I Put these lines in my 'Copy_Code.bat' file:

    CD C:\Users\admin\OneDrive\Website FESTOOL\Images\TTS_MAM Low Res\Festool_Picture_Online_Zoom_04_2018

    FOR /F "delims=" %N in (list.txt) do COPY "%N" C:\Users\admin\OneDrive\Website FESTOOL\Images\TTS_MAM Low Res\Festool_Picture_Online_Zoom_04_2018\Target


    Thank you again for your help!

    Click image for larger version. 

Name:	COPYFILES.JPG 
Views:	28 
Size:	74.6 KB 
ID:	189069
      My ComputerSystem Spec


  • Posts : 7,014
    10 Home x64 (1803) (10 Pro on 2nd pc)
       6 Days Ago #8

    @SGTOOL, the % character is a special character and will be interpreted differently if you put the command in a batch file to run it. For example, you can call a batch file and pass up to 9 parameters to it, these are available in the batch file as %1 to %9 (%0 is the name of the batch file).

    The command I gave was written for running directly from the command prompt, for use in a batch file you need to 'escape' the % character by typing it twice, eg: use %%N in the batch file wher you would use %N on the command line. The first % is interpreted by the batch file processing, which strip out the first % and pass the second % to the command line it will run.
      My ComputersSystem Spec

  •    6 Days Ago #9

    Thank you @Bree
    I added the % character and the command prompt window open briefly, scrolled through many lines then closed - nothing copied to \target.

    In the command prompt window I pasted the original command with one % character and got the same results.

    It displayed an error after each attempt of each file name ' The syntax of the command is incorrect'
    Click image for larger version. 

Name:	COPYFILES2.JPG 
Views:	3 
Size:	122.1 KB 
ID:	189131
      My ComputerSystem Spec


  • Posts : 7,014
    10 Home x64 (1803) (10 Pro on 2nd pc)
       6 Days Ago #10

    SGTOOL said: View Post
    ... the command prompt window open briefly, scrolled through many lines then closed...
    You can add the PAUSE command as the last line in the batch file to keep the window open until you hit any key.

    ...It displayed an error after each attempt of each file name ' The syntax of the command is incorrect'
    You are deep down in the directory structure there, and if you included the full path to the text file and for the target folder this may have caused your problems (too long a command line?).

    As your Target is a subfolder of the directory you are running the command from you don't need the full path, it is assumed that you mean a folder in the current path. Same for the text file, make sure it's in the source folder so you can just use the filename without a path. Try this at the command prompt...

    FOR /F "delims=" %N in (textfile.txt) do COPY "%N" Target

    Click image for larger version. 

Name:	FOR-copy.PNG 
Views:	2 
Size:	27.3 KB 
ID:	189135
      My ComputersSystem Spec


  •  
    Page 1 of 2 12 LastLast

    Related Threads
    Hi. Below link shows a method to do that, but its probably for older versions of windows. How to Copy a List of Files in a Windows Folder Into an Excel List | Chron.com In windows 10, when I Shift+right click on a folder to open the Powershell...
    I have a problem with a program not saving preset data. Possibly due to harlink extenstion with only one piece of software. I use symbolic hardlinks on my system but I do not know if the following has any bearing on the issue with the software I...
    I want to move pictures I have taken with my Windows 10 Tablet to an external usb. I can copy them one at a time, but I would like to be able to select several picture by hitting the ctrl key or the shift key, but when I bring up the on screen...
    - Winkey, “cmd” - “cd e:\media\trainingvids” - “dir *.* /s /b /a -d > c:\temp\dork.txt” So, with that I'm opening a command prompt, changing to the correct directory, doing a directory listing of all files (including sub-directories (/s), no...
    When I launch file explorer and get the home view, it is showing a bunch of filenames in Chinese characters (see attached screenshot) which it says are in the desktop folder. However there are no such files when I look at the desktop folder. WTF? ...

    Tags for this Thread

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

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