Luis Diaz
asked on
Batch or VBscript: Transfer/replace files if they exist from one folder to other folders.
Hello Experts,
I am looking for a Batch or a VBS script that covers the following needs :
I have a Root folder C:\Root in which I have specific files ie C.jar, T.jar, A.jar and another folder with the following Name C:\Interface.
In this C:\Interface folder there are multiple folders interface1, interface2 etc…
Every subfolder have a lib folder it can be located in a sub-folder (level-1) or sub-sub-folder (level-2)
What I want is to launch a Batch and or a VBS in which I will be able to report based on a csv config file or directly in the batch or VBS file (the best will be a config csv file with the information reported bellow) and transfer (replace) all the files in C:\Root folder if they exist in sub levels of C:\Interface folder.
The config file should have the following parameters:
• Source_Folder (folder in which are located the files that I want to transfer)
• Source_Files (files that I want to replace located in Source_Folder)
• Destination_Folder (Top level in which is located my folders which contains the subfolders composed by the files that I want to replaced from Source_Folder
The tricky thing is that the files can be in a sub-level2 or sub-level3 the folders located in Destination_Folder as a result the script should be able to recursively drill down sub-folder of Destination_Folder and check if they exist if so Replace the reported files.
Example of config file
Source_Folder; Source__Files ; Destination_Folder
C:\Source; C.jar,T.jar, A.jar;C:\Interface
I put a semicolon to distinguish fields of config file and a comma “,” to distinguish the files reported in Source_Files, if this is not ok don’t hesitate to modify it.
If you have questions, please don’t hesitate to contact me.
Thank you very much for your help.
I am looking for a Batch or a VBS script that covers the following needs :
I have a Root folder C:\Root in which I have specific files ie C.jar, T.jar, A.jar and another folder with the following Name C:\Interface.
In this C:\Interface folder there are multiple folders interface1, interface2 etc…
Every subfolder have a lib folder it can be located in a sub-folder (level-1) or sub-sub-folder (level-2)
What I want is to launch a Batch and or a VBS in which I will be able to report based on a csv config file or directly in the batch or VBS file (the best will be a config csv file with the information reported bellow) and transfer (replace) all the files in C:\Root folder if they exist in sub levels of C:\Interface folder.
The config file should have the following parameters:
• Source_Folder (folder in which are located the files that I want to transfer)
• Source_Files (files that I want to replace located in Source_Folder)
• Destination_Folder (Top level in which is located my folders which contains the subfolders composed by the files that I want to replaced from Source_Folder
The tricky thing is that the files can be in a sub-level2 or sub-level3 the folders located in Destination_Folder as a result the script should be able to recursively drill down sub-folder of Destination_Folder and check if they exist if so Replace the reported files.
Example of config file
Source_Folder; Source__Files ; Destination_Folder
C:\Source; C.jar,T.jar, A.jar;C:\Interface
I put a semicolon to distinguish fields of config file and a comma “,” to distinguish the files reported in Source_Files, if this is not ok don’t hesitate to modify it.
If you have questions, please don’t hesitate to contact me.
Thank you very much for your help.
ASKER
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you very much for this proposal.
Unable to test it today. I will test it tomorrow.
Thank you again.
Unable to test it today. I will test it tomorrow.
Thank you again.
ASKER
Sorry for the delay, unable to test it. I will try to test it before Monday.
Thank you.
Thank you.
ASKER
Sorry for the delay. I tested and it works!! Thank you very much for your help!
Open in new window
We will need to add conditions here I guess - can you post a sample of your csv file?