hi
i have file 'run.bat' in folder D:\math, and i want copy this file to all subfolder math.
subfolder like this:
d:\math\1103\[86]-1103-math
d:\math\1103\[87]-1103-math
d:\math\1103\[88]-1103-(A)-math
d:\math\1103\[89]-1103-3001-math
d:\math\1103\[90]-1103-(B)-math
d:\math\1105\[86]-1105-math
d:\math\1105\[87]-1105-math
d:\math\1105\[88]-1105-(B)-math
d:\math\1105\[89]-1105-5018-(E)-math
d:\math\1105\[90]-1105-(C)-math
d:\math\1105\[91]-1105-(A)-math
d:\math\1105\[92]-1105-math
.
.
.
copy one file to all subfolder
Moderator: DosItHelp
Re: copy one file to all subfolder
do you want the script to copy something else to all the sub-folders or do you want the script to copy itself to all the subfolders?
maybe this may help you:
maybe this may help you:
Code: Select all
XCOPY file.extension d:\math\*\*
Re: copy one file to all subfolder
Untested:
Regards
aGerman
Code: Select all
for /d /r "d:\math" %%i in (*-math) do copy "myfile.ext" "%%~i\"
Regards
aGerman