Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

VBScript that will back up these Lotus Notes Files

Posted on 2009-04-24
4
Medium Priority
?
733 Views
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
user.id                   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!
0
Comment
Question by:itsmevic
  • 2
  • 2
4 Comments
 
LVL 10

Expert Comment

by:TakedaT
ID: 24227734
When you say to scan for these files, do you mean to scan the entire c drive or just to scan a particular directory?
0
 

Author Comment

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

c:\Program Files\LOTUS\Notes\Data

and

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  ( :
0
 
LVL 10

Accepted Solution

by:
TakedaT earned 2000 total points
ID: 24228138
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) = "user.id" : 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"
	wscript.quit
End If
 
For x=0 to 9
	strCopyFrom = ""
	SearchDir objDir,arrFiles(x)
	If strCopyFrom <> "" then
		objFSO.CopyFile strCopyFrom,strDest
	End If
Next
Function SearchDir(strCurrentDir,strFileName)
	For Each file In strCurrentDir.Files
		If file.name = strFileName then
			strCopyFrom = strCurrentDir&"\"&file.name
		End If
	Next
	For Each folder In strCurrentDir.SubFolders
		SearchDir folder,strFileName
	Next
End Function

Open in new window

0
 

Author Closing Comment

by:itsmevic
ID: 31574309
good scripts are a beatiful thing ( :  Thank you, very good work!
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 …
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

810 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