You can use
Private Declare Function SetEnvironmentVariable Lib "kernel32.dll" Alias _
"SetEnvironmentVariableA" (ByVal lpName As String, ByVal lpValue As
String) _
As Long
to set a variable for the executing program and programs called by it (after change). But that is a session local change, i.e. after program termination the setting is gone.
Main Topics
Browse All Topics





by: AbqBillPosted on 2009-05-24 at 18:27:29ID: 24463873
Hi Esperon, the shell script (batch file) only changes the environment variable for the cmd.exe session that runs it. When that cmd.exe session terminates, so does the environment variable change. You can work around this by using some other kind of storage such as a temporary file or a registry modification. Bill.