VBScript that will back up these Lotus Notes Files

Posted on 2009-04-24
Last Modified: 2012-05-06
Hi There Experts!

     I'd like to see if I might get a few suggestions on how to back up the following files to my external hard drive using a vbscript.

     I need to backup the following files:

File Name              Present Location                                     Backup Destination
names.nsf             c:\Program Files\LOTUS\notes\data        F:\Notes-Backup
bookmark.nsf        c:\Program Files\LOTUS\notes\data        F:\Notes-Backup
Desktop8.ndk        ?                                                              F:\Notes-Backup
notes.ini                c:\Program Files\LOTUS\notes                F:\Notes-Backup                   c:\Program Files\LOTUS\notes\data       F:\Notes-Backup
archive.nsf            c:\Program Files\LOTUS\notes\data\archive  F:\Notes-Backup
replica.nsf             c:\Program Files\LOTUS\notes\data\mail  F:\Notes-Backup
journal.nsf             ?                                                             F:\Notes-Backup
user.dic                 c:\Program Files\LOTUS\notes\data      F:\Notes-Backup
headlines.nsf        ?                                                            F:\Notes-Backup

You'll notice I have a question mark in those files, I'm sure these very from each Notes user on whether or not they use them or not but if they script could go out and scan for these file types as well on the C drive and then create the copy at the Destination if found, that would be great.

Any help is greatly appreciated!
Question by:itsmevic
    LVL 10

    Expert Comment

    When you say to scan for these files, do you mean to scan the entire c drive or just to scan a particular directory?

    Author Comment

    well these files would only be in two directories on the C drive those are:

    c:\Program Files\LOTUS\Notes\Data


    c:\Program Files\LOTUS\Notes

    Basically scan the Lotus directory for these file's I've mentioned above and then copy them to my external hard drive F:\NOTES-BACKUP\

    Hope that helps you  ( :
    LVL 10

    Accepted Solution

    Give this a try.
    dim objFSO : set objFSO = CreateObject("Scripting.FileSystemObject")
    dim strDest : strDest = "F:\Notes-Backup\"
    dim strSource : strSource = "c:\Program Files\LOTUS\notes\"
    dim strCopyFrom : strCopyFrom = ""
    dim arrFiles(9)
    Set objDir = objFSO.GetFolder(strSource)
    arrFiles(0) = "names.nsf" : arrFiles(1) = "bookmark.nsf" : arrFiles(2) = "Desktop8.ndk"
    arrFiles(3) = "notes.ini" : arrFiles(4) = "" : arrFiles(5) = "archive.nsf"
    arrFiles(6) = "replica.nsf" : arrFiles(7) = "journal.nsf" : arrFiles(8) = "user.dic"
    arrFiles(9) = "headlines.nsf"
    If not objFSO.FolderExists(strDest) then
    	MsgBox "Destination folder does not exist"
    End If
    For x=0 to 9
    	strCopyFrom = ""
    	SearchDir objDir,arrFiles(x)
    	If strCopyFrom <> "" then
    		objFSO.CopyFile strCopyFrom,strDest
    	End If
    Function SearchDir(strCurrentDir,strFileName)
    	For Each file In strCurrentDir.Files
    		If = strFileName then
    			strCopyFrom = strCurrentDir&"\"&
    		End If
    	For Each folder In strCurrentDir.SubFolders
    		SearchDir folder,strFileName
    End Function

    Open in new window


    Author Closing Comment

    good scripts are a beatiful thing ( :  Thank you, very good work!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Hello again, all.  For those of you that have been following along, you'll know that this is my third article on this topic (though it is not Part III).  This article is sort of remedial, and probably the topic with which I should have started the s…
    Introduction During my participation as a VBScript contributor at Experts Exchange, one of the most common questions I come across is this: "I have a script that runs against only one computer. How can I make it run against a list of computers in …
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now