Hi Experts,
could any one please remind me how to edit this query, so I will be able to gather not only the name of the file, but also the version and the product name?:
i've tried adding more attributes, but I was not successful in VBS:
'objDataRow.SetField 1, objFile.Size
'objDataRow.SetField 2, objFile.File.Version
'objDataRow.SetField 3, objFile.Product.Name
Only able to extract file name:
'Create Inventory data block. The following data class with below guid is already configured on server.
'Brackets are required around the dataclass guid. To get this GUID, click on the custom data class and then the hand (details).
dim objDCInstance
set objDCInstance = nse.AddDataClass ("customdataclass") '***your custom data class name here
' or "{GUID of CUSTOM DATA CLASS include brackets}"
dim objDataClass
set objDataClass = nse.AddDataBlock (objDCInstance)
'Add a new row
dim objDataRow
set objDataRow = objDataClass.AddRow
dim fileName
fileNameD = "filename.exe" '***full path and name of the file to be detected
if(objFSO.FileExists(fileNameD)) Then
'If the file exist on the computer, get the details
Set objFile = objFSO.GetFile(fileName)
objDataRow.SetField 0, objFile.Name
Else
objDataRow.SetField 0, "Not Found"
End If
' Send the NSE data to the NS server
nse.SendQueued
' msgBox nse.XML '***Uncomment this line for testing
Tnx,
Hagai