FuzMic
DataBase Tinker
- Local time
- Tomorrow, 02:13
- Joined
- Sep 13, 2006
- Messages
- 744
Hi friends
I am trying to add an extra eg C:\new to the existing path in the Environment variables using VB
I tried the following:
Declare Function SetEnvironVar Lib "kernel32" Alias "SetEnvironmentVariableA" (ByVal lpName As String, ByVal lpValue As String) As Long
Now_path$ = Environ("Path")
SetEnvironVar "path", Now_Path$ & ";C:\new"
but it did not work. Where did i go wrong?
I next tried to use Shell
Shell "cmd Path = Now_Path$ & ";C:\new"
still don't work?
I could have placed the the command line in a .bat file but i prefer to do it without an extra .bat file and i have not tinkered if it works.
Any help appreciated.
I am trying to add an extra eg C:\new to the existing path in the Environment variables using VB
I tried the following:
Declare Function SetEnvironVar Lib "kernel32" Alias "SetEnvironmentVariableA" (ByVal lpName As String, ByVal lpValue As String) As Long
Now_path$ = Environ("Path")
SetEnvironVar "path", Now_Path$ & ";C:\new"
but it did not work. Where did i go wrong?
I next tried to use Shell
Shell "cmd Path = Now_Path$ & ";C:\new"
still don't work?
I could have placed the the command line in a .bat file but i prefer to do it without an extra .bat file and i have not tinkered if it works.
Any help appreciated.
Last edited: