Hi,
i have the problem to create some enviromentvariable int NT within my prog but i don't know how to do that. Does anyone knows the API-Function or ways how i can do that?
thanks
akademos
Printable View
Hi,
i have the problem to create some enviromentvariable int NT within my prog but i don't know how to do that. Does anyone knows the API-Function or ways how i can do that?
thanks
akademos
Try This:
option Explicit
private Declare Function SetEnvironmentVariable Lib "kernel32" Alias "SetEnvironmentVariableA" (byval lpName as string, byval lpValue as string) as Long
private Declare Function GetEnvironmentVariable Lib "kernel32" Alias "GetEnvironmentVariableA" (byval lpName as string, byval lpBuffer as string, byval nSize as Long) as Long
private Sub Form_Load()
Dim strBuffer as string
strBuffer = Space(20)
SetEnvironmentVariable "Somevar", "Somevalue"
GetEnvironmentVariable "Somevar", strBuffer, 20
MsgBox strBuffer
End Sub
try with this code..
I don't test it....
'declaration
public function SetEnvironmentVariable lib "kernel32.dll" (byval lpName as string,byval lpValue as string) as boolean
or
public function SetEnvironmentVariable lib "kernel32.dll" (byval lpName as string,byval lpValue as string) as integer
'sample of call
dim b as boolean 'or integer
b = SetEnvironmentVariable ("Path","mypath")
hi,brt
<center>
<HR width=80%>
<img src='http://web.tiscali.it/bertaplanet/im...ertaplanet.gif'>
</center>