Results 1 to 2 of 2

Thread: Setting Environment Variables

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 2001
    Posts
    217

    Setting Environment Variables

    Does anybody know how to set an environment variable in vb?

    In dos we would just use

    set variable=value

    but i'd like to do this would showing a command window.

  2. #2
    Hyperactive Member Alan777's Avatar
    Join Date
    Jan 2001
    Location
    New Zealand
    Posts
    303
    Private Declare Function SetEnvironmentVariable Lib "kernel32" Alias "SetEnvironmentVariableA" (ByVal lpName As String, ByVal lpValue As String) As Long

    Declare Function GetEnvironmentVariable Lib "kernel32" Alias "GetEnvironmentVariableA" (ByVal lpName As String, ByVal lpBuffer As String, ByVal nSize As Long) As Long
    "Today's mighty oak is just yesterday's nut,
    that held its ground."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width