Copying a file to multiple folders in the same directory

前端 未结 2 1078
故里飘歌
故里飘歌 2021-01-03 05:52

I have a file, lets call it EXAMPLE.DBF

The location of this file is C:\\EXAMPLE.DBF

Now I would like to copy this file into multiple folders at

2条回答
  •  梦毁少年i
    2021-01-03 06:33

    Just a small addition to @Magoo's answer;

    in case the destination folders have spaces in their names, use double quotes like this: for /d %a in (d:\bootd\hello\2014*) do copy /y C:\EXAMPLE.DBF "%a\"

    and as pointed out by @ian0411, in case source folder has spaces in its name, use double quotes like this: for /d %a in (d:\bootd\hello\2014*) do copy /y "C:\EXAMPLE.DBF" %a\

提交回复
热议问题