fantamen
asked on
Add an environment variable in vb net
I need to call an external application and before calling some environment variable have to be set. I use the windows api SetEnvironmentVariable but it doesn't work. Is there another method to do this operation?
' This is the declaration.
Declare Function SetEnvironmentVariable Lib "kernel32" Alias "SetEnvironmentVariableA" (ByVal lpName As String, ByVal lpValue As String) As Integer
' This is the instruction.
SetEnvResult = SetEnvironmentVariable("Mfextmap", lc_mfextmap)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Ok
http://blog.jtbworld.com/2005/11/set-environment-variable-using-vbnet.html