Tip

Setting ECL at user login

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

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

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:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.