btger.blogg.se

Windows find files containing text command line
Windows find files containing text command line









windows find files containing text command line windows find files containing text command line

If the text file contains the full path and filename on each line, eg:Ĭ:\Users\Me\Pictures\SourceFiles\Filename.jpg To go to that folder, first use the 'change directory' command: CD 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. The quotes around %N in 'copy "%N"' allows for any filenames that contain spacesĬ:\Destination specifies the folder you want to copy to (it must already exist, create it first if necessary) "delims=" says use the whole of each line as the parameter %N 'for' loops through all the filenames in list.txt

windows find files containing text command line

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:įOR /F "delims=" %N in (list.txt) do COPY "%N" C:\Destination











Windows find files containing text command line