Hi LarsD,
I was also looking for the same script and luckily found yours. Thank you very much!!
I am able to run the script on the agent and can see that the line am expecting is writing to a .MIF file, but this line is not updating the value under Additional inventory. Can you throw some light on this?
My script
Dim LocalPath As String
LocalPath = "C:\Program Files\CA\DMS Script Utilities\"
Dim objFile as integer
Dim strFileSource as string
Dim iRow as integer
Dim strRow as string
Dim iGetRow as integer
iRow = 1
iGetRow = 2
strFileSource = "C:\Program Files\CA\Test.txt"
objFile=OpenFile(strFileSource,O_READ)
while Not(Eof(objFile))
if iRow = iGetRow then
ReadFile(objFile,strRow)
Goto End
end if
ReadFile(objFile,strRow)
iRow = iRow + 1
Wend
End:
CloseFile(objFile)
CreateMIFFile(localpath+"ReadFromFile.mif","ReadFromFile","","")
CreateMIFGroup(localpath+"ReadFromFile.mif","Data","","")
CreateMIFString(localpath+"ReadFromFile.mif","Data","Text",strRow,"From C:\Program Files\CA\Test.txt")
Output in MIF file:
Start Component
Name = "ReadFromFile"
Description = ""
Start Group
Name = "Data"
ID = 1
Class = ""
Description = ""
Start Attribute
Name = "Text"
ID = 1
Description = "From C:\Program Files\CA\Test.txt"
Type = String(64)
Value = "this is testing"
End Attribute
End Group
End Component