I am going crazy! :confused:
Does anyone know how to create a permanent environment variable via run-time or a batch file?
Thanks
Printable View
I am going crazy! :confused:
Does anyone know how to create a permanent environment variable via run-time or a batch file?
Thanks
Take a look at the Environment.SetEnvironmentVariable method.
Environment.SetEnvironmentVariable looks like it might work.
What about with a batch file?
What about it? That a batch file thing, not a vb thing.Quote:
Originally Posted by w8taminute
Via a batch file:
Via .Net code:Code:SETX MyVarName "Hello World!"
I've just tried and tested both and they insert user environment variables fine.Code:Public Class Form1
Private Sub Form1_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles Me.Load
Environment.SetEnvironmentVariable ("MyNewVar", _
"Hello World!", EnvironmentVariableTarget.User)
End Sub
End Class
Thanks alot!