Tuesday, December 22, 2009

%TEMP% - Temporary Folder path in Lotussscript

'@Author : Karthikeyan A
'@Purpose : To get the folder path of the windows temp folder configured in Notes.ini
'@Type : Function
'@Name : getTempFolderPath
'@Return : String (path of the temp folder)
Function getTempFolderPath() As String

'declare the session object to refer the current user's session
Dim session As New notessession

'variable to hold the path of the temp folder
Dim tempDir As String

'get the mentioned environment string value from the notes.ini file
tempDir = session.GetEnvironmentString("SU_FILE_CLEANUP",True)

'the above value shall return a value like "C:\DOCUME~1\....\Temp\smkits"
'skip the contents after the word Temp in the string

'return the resultant as the temp folder's path
End Function


  1. Following seems to be good solution too...

    Dim GetSystemTempFolder As String
    'Get the temp folders file path to save excel sheet
    Select Case session.Platform
    Case "Macintosh", "Linux", "UNIX"
    GetSystemTempFolder = "/tmp"
    Case "Windows/32"
    GetSystemTempFolder = Environ("TEMP")
    Case Else
    End Select

  2. This comment has been removed by the author.

  3. I want to access local temp directory from browser using lotusscript