Can I copy multiple named files on the Windows command line using a single “copy” command?

You can use ‘for’ either in a batch file or directly from the command prompt:

for %I in (file1.txt file2.txt file3.txt) do copy %I c:\somedir\

Wildcards are supported in the filelist as well:

for %I in (*.txt *.doc *.html) do copy %I c:\somedir\

For more info, just type for /? from a command prompt, or for a much easier to read help use Start->Help and Support and search for “For”. On my XP Pro box, it was item 15 in the full text search results.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)