Friday, January 19, 2007

Single user backup script for Lotus Notes Part 2.

Sorry I've been slammed at work and such so I have not had much time to post.

Here is the 2nd part of the single user backup for Lotus Notes.
Mind you it is nothing spectacular (but it can be very useful).
It is a simple VBS I modified from the Microsoft script center. Here is the code...

Const ForReading = 1
Const ForWriting = 2

set re=new regexp

'Opens notes.ini within the backup folder that was
'created in the first script
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("C:\notesbackup\notes.ini", ForReading)

'Reads all the lines of the file and looks for "Directory="
strText = objFile.ReadAll
re.pattern="Directory=.+\n"
objFile.Close

'Replaces the Directory= with your desired location.
strNewText = re.Replace(strText, "Directory=C:\Program Files\lotus\notes\data" & vbCrLF & "")

'Closes up the notes.ini
Set objFile = objFSO.OpenTextFile("C:\notesbackup\notes.ini", ForWriting)
objFile.WriteLine strNewText
objFile.Close
So there it is. Post a comment if you need any help!

No comments:

Disclaimer

All data and information provided on this site is for informational purposes only. adminbromo.blogspot.com makes no representations as to accuracy, completeness, currentness, suitability, or validity of any information on this site and will not be liable for any errors, omissions, or delays in this information or any losses, injuries, or damages arising from its display or use. All information is provided on an as-is basis.