Highlights
All Snippets
Top 100 Snippets
Librarians
gbCodeLib

By Language
VB6
JavaScript
Perl
HTML
SQL
Java
DOS

GBIC >> Source Code >> Visual Basic >> Snippet

Set environmental variables


Private Declare Function SetEnvironmentVariable Lib "kernel32.dll" Alias _
    "SetEnvironmentVariableA" ( ByVal lpName As String , ByVal lpValue As String ) _
    As Long

'code:
Private Sub Form_Load()
    Dim rvl As Long
   rvl = SetEnvironmentVariable( "TEMP" , "C:\windows\temp" )
   rvl = SetEnvironmentVariable( "PATH" , "C:\windows;C:\windows\command" )
   End
End Sub