0

I have a folder with some content which I want to copy into 260 folders.

I guess this is doable with a bat-file and a for-loop, but I can't seem to understand how to do it. Anyone keen to help? :)

2
  • how do you have the other folders listed? do we have to find them, or do you have a list of the folders?
    – SeanC
    Jul 3, 2012 at 15:15
  • it is all folders inside another folder
    – Øyvind
    Jul 4, 2012 at 10:21

2 Answers 2

0

this will copy a file into every sub folder, 1 level down, so it will copy into dir1 but not into dir1\subdir

for /f "delims=" %a in ('dir /ad /b') do copy filename.ext "%a"

if you need it in every folder, from the directory you type this in down throughout the whole diredctory structure, add /s to the dir command: 'dir /s /ad /b'. this will get dir1, dir1\subdir and even dir1\subdir\a\a\a\a\a\a

0

This worked for me.

FOR /D %%a in ("dst\*") do 
   xcopy "src\*.*"  "%%a" /s /i /c /y

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .