Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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? :)

share|improve this question
    
how do you have the other folders listed? do we have to find them, or do you have a list of the folders? –  Sean Cheshire Jul 3 '12 at 15:15
    
it is all folders inside another folder –  Øyvind Jul 4 '12 at 10:21

2 Answers 2

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

share|improve this answer
up vote 0 down vote accepted

This worked for me.

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.