Personal Blog of Thomas Hampel - Creative Mythbusting in Development and Collaboration

Who am I?


Previous Document Next Document

Backup Notes ID on local computer

Thomas Hampel
 14 January 2013

On special request of a customer, I'm posting a little LotusScript to back up the current NotesID locally.

        Dim s As New NotesSession
        Dim NotesID$, BackupID$, NotesData$
        NotesData = s.Getenvironmentstring("Directory", True)
        NotesID$ = s.Getenvironmentstring("KeyFileName", True)
        '# check if the 2nd character in the string NotesID is a ':'
        If Not Right(Left(NotesID$,2),1) = ":" Then
                '# NotesID is located within Data Directory
                NotesID$ = NotesData$ & "\" & NotesID$                
        End If
        Print "Current NotesID is : " & NotesID$
        BackupID$ = NotesID$ & ".bak"
        Print "Backup will be stored in : " & BackupID$
        If Dir$ (BackupID$,0)="" Then
                '# No previous backup found, so okay to continue
                '# Previous backup found, so deleting existing file and create a new backup
                Print "Previous backup found, so deleting existing file and create a new backup"
                Kill BackupID$
        End If
        Print "Creating a backup of your NotesID in : " & BackupID$
        FileCopy NotesID$, BackupID$
        MsgBox "A backup of you Notes User ID was created in " & Chr(13) & BackupID$

Tagged with: Code Notes Tools
No Comments Found
Go ElsewhereSubscribe to RSSAboutStay ConnectedAnd More
Thomas Hampel, All rights reserved.