Avoid to insert twice Lotus password for ncompact and nupdall

Hi,

I have to create a button for the user to make an offline compact and updall to a local directory within Notes\data.

This activity take several hours. My problem is that I have to find a solution that once the user types in his Notes password for ncompact this shouldn’t happen for the second step “nupdall”.

How can I tell to Notes that it has to use the same login for both tasks? So that the usere has not check after 2 or three hours to re-type his password to start the second task.

Any help is very welcome.

Thanks in advance for your help and support.

Kind regards

Antonino

To understand my problem here’s my script example:

Option Declare

Const W_API_MODULE = “nnotes”

Declare Sub subwOSGetExecutableDirectory Lib W_API_MODULE Alias “OSGetExecutableDirectory” (Byval v_strRetPathName As String)

Sub Click(Source As Button)

On Error Goto ErrHandler

Dim session As New NotesSession 

Dim dbesales As New NotesDatabase ("", "")

Dim sPath As String 

Dim sNotesPath As String 

Dim sFile As String

Dim ptr As Integer 

Dim i As Integer 

Dim z As Integer 

Dim iResult As Integer

Dim iFileNum As Integer 



iFileNum = Freefile ()



If dbesales.OpenByReplicaID( "", "C123456780400404" ) Then

	sPath = dbesales.FilePath 	

	sFile = "sales_resc.bat"

	

	'Get the notes program directory:		

	sNotesPath = String$(127,0)

	Call subwOSGetExecutableDirectory(sNotesPath)

	z=0		

	For i = 1 To Len (sPath)

		If Mid$ (sPath, i, 1) = "\" Then

			z = i

		End If

		

	Next

	If z > 0 Then

		sPath = Left$ (sPath, z)

	Else

		sPath = ""

	End If

	

	Chdir sNotesPath

	Msgbox "Bitte schließen Sie jetzt die  Datenbanken, falls Sie geöffnet ist und klicken Sie anschliessend auf OK./" + Chr(13) +"Please close the  databases now and click OK to continue.", 64, "compact tool"

	

	Open sFile For Output As #iFileNum 

	Print #iFileNum, "@ECHO OFF"

	Print #iFileNum, "ECHO Bitte geben Sie Ihr Notes Kennwort ein und druecken Sie Enter, "

	Print #iFileNum, "ECHO falls Sie dazu aufgefordert werden."

	Print #iFileNum, "ECHO Please enter your Notes passwort if required and press enter."

	Print #iFileNum, "ECHO ------------------------------------------------------------------"

	Print #iFileNum, "@ECHO ON"		

	Print #iFileNum, "ncompact " & sPath & " -c -i"

	Print #iFileNum, "@ECHO OFF"

	Print #iFileNum, "ECHO Komprimierung beendet / Compact complete."

	Print #iFileNum, "ECHO ------------------------------------------------------------------"

	Print #iFileNum, "ECHO Start Neuaufbau des Ansichts-Index / Start of view index rebuild."

	Print #iFileNum, "@ECHO ON"

	Print #iFileNum, "nupdall " & sPath & " -r"

	Print #iFileNum, "@ECHO OFF"

	Print #iFileNum, "ECHO ------------------------------------------------------------------"

	Print #iFileNum, "ECHO View update beendet / complete."

	Print #iFileNum, "Pause"

	Print #iFileNum, "DEL " & sFile

	Close

	

	iResult = Shell (sFile, 1)

	

	If iResult <> 33 Then

		Msgbox "Die Komprimierung der Datenbank konnte nicht gestartet werden. Bitte wenden Sie sich an das Notes Team./" & Chr(13) & "The database could not be compacted. Please contact the Notes Team.", 48, "Error"

	End If

	

Else

	Msgbox "A local replica of the database could not be found on your computer.", 48, "Error"

End If

ExitS:

Exit Sub

ErrHandler:

Msgbox "The following error occured: " & Error$ & " (" & Cstr(Err) & ") in line " & Cstr (Erl) & Chr(13) & "Please contact the Lotus Notes Team." , 48, "Fehler / Error"

Resume ExitS

End Sub