General discussion


Copy to many directories simultaneously.

By ippirate ·
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.
R:\Project Folder\800Series\PR851\Current\Data\Tooling\

I would like to add the subdirectory \3D to each of these (roughly 900 instances)
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.
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?

This conversation is currently closed to new comments.

4 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by dryflies In reply to Copy to many directories ...

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.

Collapse -

by ippirate In reply to

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


Collapse -

by ippirate In reply to Copy to many directories ...

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

Collapse -

by ippirate In reply to Copy to many directories ...

This question was closed by the author

Back to Desktop Forum
4 total posts (Page 1 of 1)  

Related Discussions

Related Forums