How do I copy a file using a wildcard in Windows without appending?
command-line, windows
Solution
I can't reproduce your reported problem.
DO you mean the source file is emptied, or that the target is empty?
I'd add the `/b` switch to the `COPY`
copy /B \Source\F_02262014* \Target\CurrentFile.xlsx
...worked for me!
Problem
I have an excel file that I download from an vendor FTP site on a daily basis. Every day the file name changes to contain the date and the vendor appends either "actual" or "estimate" to the end of the file. example: F_02262014_actual.xlsx F_02262014_estimate.xlsx etc. Because of these slight changes, I'm using a wildcard to copy the file to a consistent name in another directory. Example: copy \Source\F_02262014* \Target\CurrentFile.xlsx My problem is that whenever I use a wildcard in the copy command, Windows assumes I'm appending several files to one. This causes the file to get corrupted (all contents deleted for some reason). Is there a command, or series of commands, that will copy the first file matching the file pattern to the desired file name?