|
-
August 30th, 2001, 07:05 AM
#1
Creating Enviromentvariable
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
-
August 30th, 2001, 08:14 AM
#2
Re: Creating Enviromentvariable
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
-
August 30th, 2001, 08:18 AM
#3
Re: Creating Enviromentvariable
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>
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
|