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

Page 2 of 4 FirstFirst 1234 LastLast

  1. Posts : 2,450
    Windows 10 Pro x64
       #11

    Guys the destination path has "spaces"
    C:\Users\admin\OneDrive\Website FESTOOL\Images\TTS_MAM Low Res\Festool_Picture_Online_Zoom_04_2018\Target

    Enclose the Destination in quotes:

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


  2. Posts : 31,660
    10 Home x64 (22H2) (10 Pro on 2nd pc)
       #12

    ddelo said:
    Guys the destination path has "spaces"
    C:\Users\admin\OneDrive\Website FESTOOL\Images\TTS_MAM Low Res\Festool_Picture_Online_Zoom_04_2018\Target
    Well spotted!


    But actually, the full path isn't even needed. Relative paths are sufficient in this case and there's no space in the subfolder's name 'Target' to cause a problem.
      My Computers


  3. Posts : 2,450
    Windows 10 Pro x64
       #13

    Bree said:
    Well spotted!


    But actually, the full path isn't even needed, relative paths are sufficient in this case.
    We agree. But since used, it requires quotes!!! :)
    That's why when parsing the command the command interpreter finds the space and does not recognize as a valid command, the rest of it!
      My Computer


  4. Posts : 31,660
    10 Home x64 (22H2) (10 Pro on 2nd pc)
       #14

    ddelo said:
    We agree. But since used, it requires quotes!!! :)
    Thanks for spotting the 'Gremlin'. Either way, @SGTOOL has the solution now :)
      My Computers


  5. Posts : 2,450
    Windows 10 Pro x64
       #15

    Bree said:
    Thanks for spotting the 'Gremlin'. Either way, @SGTOOL has the solution now :)
    Teamwork my friend!!! :)
      My Computer


  6. Posts : 5
    Win10
    Thread Starter
       #16

    @Bree
    Thank you so much for you patience with my skill level. This is working exactly as I needed.
    -Rick
      My Computer


  7. Posts : 31,660
    10 Home x64 (22H2) (10 Pro on 2nd pc)
       #17

    Glad to have helped.

    Your skill level has just gone up a notch or two - you've learned so important command line and batch file skills along the way. :)
      My Computers


  8. Posts : 5
    windows 10
       #18

    i have unexpected error what to do


    Bree said:
    You can add the PAUSE command as the last line in the batch file to keep the window open until you hit any key.



    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

    Attachment 189135


    i have error

    listflyer.txt was unexpected at this time.
    what to do?
    How Do I select multiple files in a folder from a list of file names-xxxx.jpg
      My Computer


  9. Posts : 7,904
    Windows 11 Pro 64 bit
       #19

    Berton said:
    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.
    In File Explorer there is also an option to enable Item Check Boxes which you might find easier to use
      My Computers


  10. Posts : 31,660
    10 Home x64 (22H2) (10 Pro on 2nd pc)
       #20

    malkasun said:
    i have error

    listflyer.txt was unexpected at this time.
    what to do?
    your command line was:
    FOR /F "delims=" %N in listflyer.txt do COPY "%%N" I:\Youtube download\Photoshop Tutorial Poster flyer

    Compare that with the example in Post #11 and you'll spot a few differences.

    You left out the brackets inside the FOR...DO part: (listflyer.txt) which is why listflyer.txt was unexpected.

    You used %N then %%N in the same line. On a command line both should only have one %. Only in a batch file do you have use two %% but in that case both shoud be %%N.

    The destination name includes spaces, so it needs quotes around it: "I:\Youtube download\Photoshop Tutorial Poster flyer"


    So the corrected command line you should have typed is:
    FOR /F "delims=" %N in (listflyer.txt) do COPY "%N" "I:\Youtube download\Photoshop Tutorial Poster flyer"

    If you put the command in a .bat file to run it from there, then you need to use %%N instead of %N because the first % gets stripped off by the command interpreter as it runs the file.
      My Computers


 

  Related Discussions
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 20:31.
Find Us




Windows 10 Forums