Private Function AppendPath(basepath as String) As Integer ' appends notes paths to $Path if missing ' returns 0 for failure, 1 for ok, 2 for updated ' basepath - path to lotus folder - e.g. c:\lotus\ Dim WshShell ' cmd shell to get/set path Dim WshEnv ' environmental variables object Dim curpath As String ' current path from WshEnv Path variable Dim addpath As String ' path to check/add On Error GoTo AppendPathErrorHandler ' start with status = okay, already in path AppendPath = 1 'get shell Set WshShell = CreateObject("WScript.Shell") Set WshEnv = WshShell.Environment("SYSTEM") curpath = WshEnv("PATH") ' check for notes executable directory (contains notes.ini) addpath = basepath + "\notes" If Not (InStr(1, curpath, addpath, vbTextCompare) > 0) Then 'If it already exists, don't add it again If Right(curpath, 1) <> ";" Then curpath = curpath & ";" 'check for semi colon at the end curpath = curpath & addpath AppendPath = 2 WshEnv.Item("PATH") = curpath End If ' check for the notes data folder in path addpath = basepath + "\notes\data" If Not (InStr(1, curpath, addpath, vbTextCompare) > 0) Then 'If it already exists, don't add it again If Right(curpath, 1) <> ";" Then curpath = curpath & ";" 'check for semi colon at the end curpath = curpath & addpath AppendPath = 2 WshEnv.Item("PATH") = curpath End If If (dolog = 1 And verboselogging = 1) Then Call logFile.WriteLine("$Path =" + WshEnv("PATH") + ".") End If ' done return current value AppendPathExit: Exit Function AppendPathErrorHandler: AppendPath = 0 Resume AppendPathExit Exit Function End Function