|
-
Feb 5th, 2002, 03:38 PM
#1
Thread Starter
Member
API call to append to system PATH
Hello,
Anyone know the API function to get and append to the system Path environment variable? (Windows NT/2000)
There was a post here previously that stated:
I know how to change the path using the advapi32.dll but I cannot get the path to take
... but I can't find the function that does this.
I do not need to make the change permanent, only for the duration of the process.
Thanks, Dale.
-
Feb 5th, 2002, 07:06 PM
#2
To get the system directory use the GetSystemDirectory function. You can then append to it using normal VB functions.
-
Feb 6th, 2002, 03:20 PM
#3
VB Code:
Private Declare Function SetEnvironmentVariable Lib "kernel32.dll" Alias "SetEnvironmentVariableA" (ByVal lpName As String, ByVal lpValue As String) As Long
Private Sub Command1_Click()
Dim strPath As String
Dim lngRet As Long
strPath = Environ("PATH")
Call SetEnvironmentVariable("PATH", strPath & "C:\YourOtherPath;")
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|