I want to copy a dummy text file into every subdirectory of a given directory on a network drive (Windows). Because we're looking at hundreds or thousands of subdirectories, I can't do this manually, but I can create a list of relevant directories. This list could be passed to a batch file or similar.
I'm guessing the batch file would have some sort of FOR loop that takes a line from the directory list as counter. For each iteration, the loop would just create an empty file in the directory indicated by the counter, but I lack coding skills to make the appropriate batch file.
How do I best approach this problem?
c:\help for includes an
/R switch that seems useful:
FOR /R [[drive:]path] %variable IN (set) DO command [command-parameters]
Walks the directory tree rooted at [drive:]path, executing the FOR statement in each directory of the tree. If no directory specification is specified after /R then the current directory is assumed. If set is just a single period (.) character then it will just enumerate the directory tree.
This seems straightforward, but I need to read a line from the directory list:
for %? in (.) do echo %? > dumy_file.txt
Details: My team has a shared network drive with thousands of subfolders filled with stale documentation and old working documents; it's a mess. The plan is to create a new tree structure elsewhere (done) that reflects our future file concept, and then either move or delete the files in the old tree structure. To track which subdirectories have already been "migrated" we thought it would be convenient to have a "to do" marker in the form of a dummy file that can be searched for.