vb.netvbscriptavaya

.acsauto script to save to relative filepath


I have an .acsauto script from Avaya CMS system that is saving data into a text file on a specified location:

b = cvsSrv.Reports.CreateReport(Info,Rep)
           If b Then        
           stuff
           b = Rep.ExportData("C:\Long\File\Path\report.txt", 59, 0, True, True, True)

Is there a way to make this address relative on the .ascauto script location so that the report is created e.g. next to it? The script language should be either VB or VBScript - nobody knowledgeable about the system is able to tell me - but I have not been even able to replace the direct reference by a string (the report seems to run, merely it is not saved to the desired location)

strFilePath = "C:\Long\File\Path\report.txt"
b = Rep.ExportData(strFilePath, 59, 0, True, True, True)

Solution

  • Resolved with this code change:

    dim fso, strPath
    set fso = CreateObject("Scripting.FileSystemObject")
    B = ...
         strPath = fso.GetAbsolutePathName("report.txt")
         b = Rep.ExportData(strPath, 59, 0, True, True, True)