Evaluating Windows Envrionment Variables Programmatically .NET

Posted on 2007-07-22
Last Modified: 2010-04-16
There are Windows System Variables like:


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?
Question by:coson
    LVL 142

    Accepted Solution

    yes it is. look this method:
    LVL 96

    Assisted Solution

    by:Bob Learned
    You could also use Environment.ExpandEnvironmentVariables.


    Author Comment

    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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
    Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    760 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

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now