Copying a file into multiple folders
Solved
jth
Posted messages
6
Registration date
Status
Member
Last intervention
-
dubcek Posted messages 18627 Registration date Status Contributor Last intervention -
dubcek Posted messages 18627 Registration date Status Contributor Last intervention -
Hello,
My question is simple:
In a folder named Video, I have 350 folders and a file "test.avi". I would like to use a batch file to copy the test file into the 350 folders.
If someone can explain how to do this, assuming it's possible, that would be nice.
Thank you for your help
Configuration: Windows 7 / Firefox 13.0.1
My question is simple:
In a folder named Video, I have 350 folders and a file "test.avi". I would like to use a batch file to copy the test file into the 350 folders.
If someone can explain how to do this, assuming it's possible, that would be nice.
Thank you for your help
Configuration: Windows 7 / Firefox 13.0.1
6 answers
-
hello
from the DOS command linefor /d %%a in (*.*) do @copy test.avi %%a
from a .bat file replace %a with %%a -
I tried the DOS command in a bat file saved in my Video folder by modifying as indicated "%%a" but it doesn't work... do I need to modify something else?
Thank you for your help. -
Thank you for your response, but I'm sorry I have no knowledge of programming and I don't know how to use your help...
-
Thank you for this response, it works with the bat file, and it will save me from a tedious copying job.
-
Hello,
Based on this (old) discussion:
I want to copy a folder into several directories but not all! For example, the program would only copy into the folders resulting from a previously created list (Excel, Word, Notepad, other???).
What command should be integrated for the program to read this list and distribute the folder only into the listed directories?
Thank you for your help :)-
-
Thank you very much, it works perfectly!
However, does the list absolutely have to be in ".txt"? Because I tried with Excel and a Word document, but it didn't work...
Thanks again! -
-
-
Hello,
When I execute the multiple copy from the list and the program does not find the corresponding folders (typographical error in the list, omission...), there is a message in the dialog box notifying me. My question is the following: is it possible to automatically retrieve this text and put it in a text file (for example "Report") and display it automatically?
Thank you for your help!
-
-
and in Python?
from os import walk from shutil import copy dn = 'I:\\Prov Python\\' for subdn in walk(dn).next()[1]: copy(dn + 'test.txt', dn + subdn)
walk() is a recursive generator of triplets (directory path, subdirectories, files)
By applying next(), we get the first triplet. To obtain the list of subdirectories, we need to take index 1.