How to put a 2 array variables in config (.ini) file? : <p><strong>I have this VBScript that send specific files to FTP based on the file name.</strong>
</p>

<pre><code>Option Explicit
Dim objFSO, objMyFile, objShell, strFTPScriptFileName, strFilePut
Dim strLocalFolderName, strScriptFolder, strFTPServerName, strLoginID, strReportPath
Dim strPassword, strFTPServerFolder

Dim objArg, strIniFilePath, oShell

Dim i: i = 0

'Locates the INI File
Set objArg = WScript.Arguments
strIniFilePath = objArg(0)

'Gets FTP UserId and Password
strLocalFolderName = ReadIni(strIniFilePath,"FTP","LocalFolderName")
strFTPServerName = ReadIni(strIniFilePath,"FTP","FTPServerName")
strLoginID = ReadIni(strIniFilePath,"FTP","LoginID")
strPassword = ReadIni(strIniFilePath,"FTP","Password")

strFTPScriptFileName = ReadIni(strIniFilePath,"FTP","FTPScriptFileName")

strReportPath= Array("/davaoccc" , "/calambaccc" , "/cebuccc")
strFilePut= Array("0970*.txt" , "0979*.txt" , "0983*.txt")


Set oShell = CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")


Set objFSO = CreateObject("Scripting.FileSystemObject")

If (objFSO.FileExists(strFTPScriptFileName)) Then
objFSO.DeleteFile (strFTPScriptFileName)
End If

For i = 0 To UBound(strReportPath)
Set objMyFile = objFSO.CreateTextFile(strFTPScriptFileName, True)
objMyFile.WriteLine ("open " &amp; strFTPServerName)
objMyFile.WriteLine (strLoginID)
objMyFile.WriteLine (strPassword)
objMyFile.WriteLine ("cd " &amp; strReportPath(i))
objMyFile.WriteLine ("bin")
objMyFile.WriteLine ("lcd " &amp; strLocalFolderName)
objMyFile.WriteLine ("prompt off")
objMyFile.WriteLine ("mput " &amp; strFilePut(i))
objMyFile.WriteLine ("disconnect")
objMyFile.WriteLine ("bye")
objMyFile.Close

'Execute the FTP script. 
Set objShell = WScript.CreateObject( "WScript.Shell" )
objShell.Run "ftp -s:" &amp; Chr(34) &amp; strFTPScriptFileName &amp; Chr(34), , True 

next
</code></pre>



<p><strong>This is the .ini file</strong>
</p>

<pre><code>[FTP]
LocalFolderName=D:\Output\
FTPServerName=172.22.11.220
LoginID=user
Password=1234
FTPScriptFileName=D:\FTP_Log.txt
</code></pre>



<p>As you can see, the values of the variables is in the .ini file (hardcoded value should be in the .ini files) but except for the two variables: <strong>strReportPath</strong>, <strong>strFilePut</strong></p>

<p>There are multiple destination folder in the FTP, and different files based on the filename (files starts with 0970, 0979, 0983) in which, this VBScripts successfully sends. But I am having a hard time on how to put a 2 array variables in config ini file in a way that the array variable is still in match. (e.g. /davaoccc for 0970, /calambaccc for 0979, /cebuccc for 0983)</p>

<p>Anyone know or have an idea to do it?</p>

<p>I tried to search for this on the internet but no topic for this one. A big appreciation for the answer.</p>
