Setting ECL at user login

Every Time user login to the network and after open Lotus Notes trasparently refresh the local ECL.

To reset the user workstation ECL with the Administration ECL the notes.net forum suggests to use the @RefreshECL

formula or the Session.SetEnvironmentVar("ECLSetup","1",True) method from LotusScript. Both Methods are for use with a button in a E-Mail Message.

Unfortunately they require a restart of Lotus Notes to take effect (at restart Lotus Notes read the notes.ini settings!)

I have written this script in vbscript:it execute with Login Script (Novell or Windows), search in the folder of drive c: for notes.ini, copy this file to notes.old for backup and create new copy of notes.ini with ECLSetup variables set to 1.

Every Time user login to the network and after open Lotus Notes trasparently refresh the local ECL.


Const inifile="notes.ini"
Const bckfile="notes.old"
Const root="c:"
Const oldkeyvalue="ECLSetup=3"
Const newkeyvalue="ECLSetup=1"
Dim fso 'as filesystem object
Dim path 'as string

Function search(dirbase,fname)
 Dim fold 'as folder object
 Dim subf 'as folder collection object
 Dim sinf 'as folder object

 Set fold=fso.getfolder(dirbase)
 Set subf=fold.subfolders
 search=False

 For Each sinf In subf
  path=dirbase & sinf.name & ""
  If fso.fileexists(path & fname) Then
   search=True
   modify
  End If
 Next
End Function

Sub main()
 path=""
 Set fso=CreateObject("Scripting.FileSystemObject")
 If Not search (root,inifile) Then  MsgBox "Unable to find file " & inifile 
End Sub

Sub modify ()
 On Error Resume Next
 Dim source 'as textfile
 Dim dest 'as textfile
 Dim fileline 'as string

 fso.CopyFile path & inifile,path &  bckfile,True
Set source=fso.opentextfile (path & bckfile,1)
Set dest=fso.CreateTextFile(path & inifile, True)
fileline=source.readline
While Err.Number<>62
 If fileline<>oldkeyvalue Then
   dest.writeline(fileline)
  Else
   dest.writeline(newkeyvalue)
 End If		     Fileline=source.readline
Wend
End Sub

Main
This was first published in February 2002

Dig deeper on Domino Resources - Part 6

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

SearchWinIT

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchEnterpriseLinux

SearchVirtualDataCentre.co.uk

Close