I'm writing a wsf that opens a csv, reads the contents and prints them like so:
<job id="Test_Script">
<script language="VBScript">
Dim objFSO, strSourcePath, strSourceFile, objInFile, strData
Set strSourcePath = "C:\test\ERACSV\"
Set strSourceFile = "Payments.csv"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objInFile = objFSO.OpenTextFile(strSourcePath & strSourceFile, 1, False)
Set strData = objInFile.ReadAll
objInFile.Close
WScript.Echo strData
</script>
</job>
I keep getting this weird error:
Script: C:\Users\myuser\openCSV.wsf
Line: 4
Char: 4
Error: Object Required '[string: "C:\test\ERACSV"]'
Code: 800A01A8
Source: Microsoft VBScript runtime error
It seems weird because why is the object it requiring a string I've already defined?