Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Changing User's Windows path programatically
Message
From
23/06/2009 17:18:33
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Changing User's Windows path programatically
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01407901
Message ID:
01407901
Views:
79
Hi all,

I am working with a Lotus Domino developer to integrate some aspects of a document database into a VFP app. He has given me a dll to call which has a number of functions I can use to query the Domino database. These did not work at first until I put a path to the Lotus Notes exe that does the actual calls into the Domino database. I had to append C:\Program Files\Lotus\Notes to my user path (development machine).

But I don't really want to do this for 40 odd machines. So I went looking for where the "Path" variable is stored and came up with:

HKEY_LOCAL_MACHINE|SYSTEM\CurrentControlSet\Control\Session Manager\Environment

and then the PATH variable.

Questions: I can probably figure out how to write to this registry entry but...

1) should I? Is this somehow "old school" or might it cause problems?
2) should I be writing to the "CurrentControlSet" or I noticed that when I set this var on my machine, it also showed up in the "ControlSet003" of the registry (probably pertaining to who I am logged in as).

My idea was to query the PATH at system startup and if the required Lotus Notes pathing is not in the current path, add it via the registry (with perhaps forcing the user to quit VFP as I think the change may not take effect right away).

Thoughts?
Albert
Next
Reply
Map
View

Click here to load this message in the networking platform