So the scenario is this…
I have my folder structure
- C:\
- DirectoryA
- SubdirA
- File.xml
- DirectoryB
- SubdirB
- DirectoryC
- SubdirC
.
.
.
My question is,
Is there a way to copy the file from SubdirA into ALL subdirectories of all other directories, in a batch/cmd file, without a massive list of copy statements?
Excuse me, there are a couple unclear points about this question.
At first, I thought you want to “copy the file from SubdirA into ALL subdirectories of all other directories” at the same level where the file is, that is, if SubdirB and/or SubdirC would have subdirectories beneath, the file will NOT be copied to them; just to SubdirB and SubdirC. If a DirectoryD would exist that have NOT another subdirectory beneath, the file will NOT be copied to it. The Batch file below do such process:
However, you said later: “The directories will all be at the same level, ie directly below C:” that contradicts your own example! The directories in the example are two levels down.
Please note that this point (the level of the target directories) is crucial to correctly write a Batch file (in case the file above does not solve your problem).