Please could anyone let me know if it is possible to change the path of the system directory in a program which VB picks up from the registry, and what code is required
I am not sure about what you are trying to do. The path of the system directory will never change (that is where the OS is). Are you trying to change the starting point for a common dialog box or something? Anything is possible, the problem is I only have one lifetime.
Many Thanks for your reply.
I'm trying to get VB to send a message through Lotus notes.
The only problem is when I try to run it the program looks for the notes.ini in the c:\winnt\system directory and errors saying it cannot find this file as it exist on another drive x:\notes. The c:\ is read only. I was hoping that I could repoint vb to look for this file as x:\notes.
I think the only option will be for it to be put on the c: drive.
You can change the current working drive while your program is running by doing this
[tt]
ChDrive "D" ' Make "D" the current drive.
' Change current directory or folder to "MYDIR".
ChDir "MYDIR"
' Assume "C:" is the current drive. The following statement changes
' the default directory on drive "D:". "C:" remains the current drive.
ChDir "D:\MYDIR"
[/tt]
Craig, mailto:sander@cogeco.ca
"Procrastination is the art of keeping up with yesterday."
The commands you've posted to change the drive and directory will come in very useful.
Unfortuately the vb program must be looking at the system path in the windows registry (which I cannot change), because even though I've changed the current path to x:\notes the program still looks in c:\winnt\system
Do you have a code sample of how VB is sending the message through Lotus Notes? That might clear up what you are trying to do. Anything is possible, the problem is I only have one lifetime.
Dim Session As Object
ChDir "x:\notes"
MsgBox (App.Path)
Set Session = CreateObject("Notes.NotesSession"
Dim DataBase As Object
Set DataBase = Session.GETDATABASE(sServer, sDatabase)
DataBase.OPENMAIL
Dim Document As Object
Set Document = DataBase.CREATEDOCUMENT()
Document.Form = "Memo"
With Document
.SendTo = "rtl101@csc.com"
.Subject = "Test1 OLE automation"
.Body = "Test1 OLE"
.From = Session.COMMONUSERNAME
.SAVEMESSAGEONSEND = True
.SEND True
End With
That is still going to give you a problem. If you read through my above examples. ChDir "D:\MYDIR" will change the current drive on D: drive to \MYDIR, but the curretn drive would stay as C:. You need to change it to this.
[tt]
ChDrive "x"
ChDir "x:\notes"
[/tt] Craig, mailto:sander@cogeco.ca
"Procrastination is the art of keeping up with yesterday."
I've put this in the code but VB still look for the notes.ini file in the c:\WINNT\system32 directory
When this line of code
Set Session = CreateObject("Notes.NotesSession"
is executed, I get the following error message
The NOTES.INI file cannot be found on the search path(PATH): C:\WINNT\system32\notes.ini
I'm wondering if Notes.NoteSession has this as a default. Have you tried this.
[tt]
Dim Session As Object
ChDrive "x"
ChDir "x:\notes"
MsgBox (App.Path)
Set Session = CreateObject("Notes.NotesSession"
[/tt] Craig, mailto:sander@cogeco.ca
"Procrastination is the art of keeping up with yesterday."
I've tried the code you gave
Dim Session As Object
ChDrive "x"
ChDir "x:\notes"
MsgBox (App.Path)
Set Session = CreateObject("Notes.NotesSession"
and the messagebox return x:\notes but unfortunately I still get the error message "The NOTES.INI file cannot be found on the search path(PATH): C:\WINNT\system32\notes.ini"
Okay I have something that may be a dirty fix. You can set up the directory x:\Notes with a variable. Hold down ALT and double click my computer to get the System Properties window. Click the Environment tab and add a new variable
NotesDir with the path X:\notes. Thin in your code you would call it with $NotesDir I think? Craig, mailto:sander@cogeco.ca
"Procrastination is the art of keeping up with yesterday."
It looks as if Notes is hard-coded to look at C:\Winnt\System32. I would submit a problem report to IBM, as any program should either be using the %SystemRoot% enviromental variable or the GetSystemDirectory() API call.
Well, you shouild have a local notes.ini in c:\notes then, which should then have an entry for x:\notes. Unfortunately I'm not currently anywhere near a machine with Notes installed, so I can't detail the necessary entry at the moment.
I've tried to access notes with the notes.ini file in the c:\notes directory and again with the notes.ini file in the c:\winnt\system32 directory both came up with the error that the administration program could not be run when I tried to run notes as normal.
I think I'll have to go with the option of someone logging into notes manually and then the code I've now go will actually send a message.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.