Discussion Locked

Copy to many directories simultaneously.

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have a subdirectory that I need to create in multiple similar directories. I would prefer to accomplish this through automation rather than adding each individually, one at a time.

The structure looks something like below:

R:\Project Folder\xxxSeries\PRyyy\Current\Data\Tooling\ where xxx is a number 800, 900, 1000, 1100 etc. and yyy is also number inside that series x00-x99.
Example:
R:\Project Folder\800Series\PR851\Current\Data\Tooling\

I would like to add the subdirectory \3D to each of these (roughly 900 instances)
Example:
R:\Project Folder\800Series\PR851\Current\Data\Tooling\ to
R:\Project Folder\800Series\PR851\Current\Data\Tooling\3D\

I could use the XCOPY command with the /E switch to copy the directory in but I still need a way to wildcard the directory into the parent.
Example:
R:\Project Folder\800Series\PR8xx\Current\Data\Tooling\ were xx is a wildcard. I will also need to overcome the space in Project Folder.

Any ideas?

4 replies

by dryflies

use WSH to accomplish this. write the script with two loops, one iterating the 100s and the other iterating 00-99.
assemble your string to create the directory. keep in mind you have to create 800Series in the outer loop before trying to create PR851 in the inner loop.
the following code shows the syntax for creating a directory:
Set objFSO = CreateObject("Scripting.FileSystemObject")

Set objFolder = objFSO.CreateFolder("C:\FSO")

The web site put in a carriage return where there should not be one. make the creatobject line a single line.

by ippirate

The directories are already established. I need to append the \3D to the back of them.

Thanks

by ippirate

I suppose that I should point out that the directories already exist. I need to add the folder to these directories as they stand.

This discussion is closed to new replies.