Solved

Add an environment variable in vb net

Posted on 2009-05-03
3
439 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

Suggested Solutions

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.   …
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

726 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