Summary
I need to copy zip files from one folder to another, the names of the files to copy are in another file, but without the extension
Files in source
a.zip
b.zip
c.zip
no-copy.zip
Text File Contents
a
b
c
Here is in a simple command prompt:
If you have the list file in your source folder and stand in it, you can run this in the command prompt to achieve what you need:
for /F "tokens=1" %%g in (list.txt) do (copy %%g.zip c:\folder\dest)
Explanation:
for /F "tokens=1" %%g stablish the loop saving each line of the file in variable %%g
in (list.txt) the file which have the names (without extension as you said)
do (copy %%g.zip c:\folder\dest) copy the content of the variable (which is the name of the file) plus '.zip' to c:\folder\dest.
Here's a one-liner that you can use in Powershell:
Get-Content \\path\to\textfile.txt | ForEach { Copy-Item SourceFolder\$_ DestinationFolder\$_.zip }
This is assuming you're running Windows 7 or above.
It reads your text file, and for each line, copies the file from the source folder to the destination folder while simultaneously appending a ".zip" to the filename.