Ok, so for starters I am VBScripting newbie. That said, I am trying to accomplish the following;
I am trying to automate some Robocopy jobs and would like to put together a script the will spawn multiple jobs based on the contents of a text file. The text file will contain a list of names, these names correspond to directory path. For example, the text will contain data looking as such...
The script will read the text file, line by line, spawning jobs until it reaches their are no more entries in the text file.
Source and Destination parameters will be passed via variables.
Here is what I have conceptually in psuedoscript
Dim objShell, objFSO
Dim strLog strSource, strDestination
strLog = This is the name and path of the logfile. Each robocopy job that is spawned from this script will have a unique log file. The log file name should be the 'Folder1.log, Folder2.Log, etc.. corresponding to the name given in the text file.
Set objShell = CreateObject("WScript.Shell")
DO objShell.Run" Robocopy " strSource strDestination strOptions strLog
LOOP, Keep doing this for each entry in the provided text file.
My biggest issue is that I don't know how to get the script to open the text file, read a line and do something with it then go to the next line. I also need it to pass the logfile name based on the entry in the text file.
Thanks for your help!