Solved

Add an environment variable in vb net

Posted on 2009-05-03
3
434 Views
Last Modified: 2013-11-26
I need to call an external application and before calling some environment variable have to be set. I use the windows api SetEnvironmentVariable but it doesn't work. Is there another method to do this operation?
' This is the declaration.
Declare Function SetEnvironmentVariable Lib "kernel32" Alias "SetEnvironmentVariableA" (ByVal lpName As String, ByVal lpValue As String) As Integer
'  This is the instruction.
SetEnvResult = SetEnvironmentVariable("Mfextmap", lc_mfextmap)

Open in new window

0
Comment
Question by:fantamen
  • 2
3 Comments
 
LVL 53

Expert Comment

by:Dhaest
ID: 24293084
I found that there was no easy to use .net class to set an environment variable ...

http://blog.jtbworld.com/2005/11/set-environment-variable-using-vbnet.html
0
 
LVL 53

Accepted Solution

by:
Dhaest earned 125 total points
ID: 24293089
Set System Information and Environment Variables With VB.Net

http://www.freevbcode.com/ShowCode.asp?ID=8293
0
 

Author Comment

by:fantamen
ID: 24783041
Ok
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question