[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 299
  • Last Modified:

Evaluating Windows Envrionment Variables Programmatically .NET

There are Windows System Variables like:

%SystemRoot%
%WINDIR%
%COMPUTERNAME%

I'm trying to evaluate them programmatically in .NET because I want to launch the Event Viewer applet from a button.  The path on XP is:  [%SystemRoot%\system32\eventvwr.msc /s] and I'm trying to use the
Process/ProcessStartInfo classes to do this.

Is something like this possible?
0
coson
Asked:
coson
2 Solutions
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
yes it is. look this method:
Environment.GetEnvironmentVariables
http://msdn2.microsoft.com/en-us/library/1h5xxewc.aspx
0
 
Bob LearnedCommented:
You could also use Environment.ExpandEnvironmentVariables.

Bob
0
 
cosonAuthor Commented:
I'm increasing the point values because I like both answers.  AngelIII answered my question so I will accept it as a solution, but I like ExpandEnvironmentVariables better.
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.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now