Page 1 of 1

how to copy a file in all of directory and subdirectories?

Posted: 31 Aug 2011 07:37
by Mohammad_Dos
hi there

i want to copy "c:\file.txt" in all of folders in drive D:\

how to do that?
i want to copy it in all of folders. i found a command. but it dont copy the file in folders that have space in their name

Re: how to copy a file in all of directory and subdirectorie

Posted: 31 Aug 2011 10:37
by aGerman
Try that:

Code: Select all

for /f "delims=" %%a in ('dir /ad /b /s D:\') do copy "c:\file.txt" "%%a\"

Regards
aGerman