?
Solved

Add an environment variable in vb net

Posted on 2009-05-03
3
Medium Priority
?
449 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 375 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

762 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