Hi - been asked to post this here instead of the XP/DOS section, hope I have more luck here? I don't know how to run VBScript so any pointers would be helpful!
We are facing a huge task at work to COPY thousands of folders in to a new folder structure.
The folders which need transfered are named:
\schemes\"001 Scheme name"
\schemes\"002 Scheme name"
\schemes\"003 Scheme name"
etc etc
Each of these folders need to be transfered in to their respective "Asbestos" folders shown in the path below:
\Properties\001 Random name\Asbestos
\Properties\002 Random name\Asbestos
\Properties\003 Random name\Asbestos
So as you can see (hopefully) I need to be able to transfer the, for example "001 Scheme name" folder in to an "Asbestos" folder that sits within a folder that contains the same scheme number e.g. 001, 002 etc.
So the final folder path for each scheme would look like this:
\Properties\001 Random name\Asbestos\001 Scheme name
\Properties\002 Random name\Asbestos\002 Scheme name
\Properties\003 Random name\Asbestos\003 Scheme name
So there needs to be some code which contains a wildcard to check for the scheme number e.g. move scheme folder in to "Asbestos" folder which is within folder like 001*
I think the logic would be (in a loop):
1.Return the folder name from the source directory and add it to a variable.
2.Extract the number from the folder name (only ever going to be one set of numbers in the file name).
3.Use this number to match against the folders in the destination folders and where it matches add that folder/file destination to a variable.
4. Run a copy command using the two variables from above.
Many thanks!
We are facing a huge task at work to COPY thousands of folders in to a new folder structure.
The folders which need transfered are named:
\schemes\"001 Scheme name"
\schemes\"002 Scheme name"
\schemes\"003 Scheme name"
etc etc
Each of these folders need to be transfered in to their respective "Asbestos" folders shown in the path below:
\Properties\001 Random name\Asbestos
\Properties\002 Random name\Asbestos
\Properties\003 Random name\Asbestos
So as you can see (hopefully) I need to be able to transfer the, for example "001 Scheme name" folder in to an "Asbestos" folder that sits within a folder that contains the same scheme number e.g. 001, 002 etc.
So the final folder path for each scheme would look like this:
\Properties\001 Random name\Asbestos\001 Scheme name
\Properties\002 Random name\Asbestos\002 Scheme name
\Properties\003 Random name\Asbestos\003 Scheme name
So there needs to be some code which contains a wildcard to check for the scheme number e.g. move scheme folder in to "Asbestos" folder which is within folder like 001*
I think the logic would be (in a loop):
1.Return the folder name from the source directory and add it to a variable.
2.Extract the number from the folder name (only ever going to be one set of numbers in the file name).
3.Use this number to match against the folders in the destination folders and where it matches add that folder/file destination to a variable.
4. Run a copy command using the two variables from above.
Many thanks!