none
C# code to launch an application which contains an Environment Variable RRS feed

  • Question

  • I have an Environment Variable

    Variable Name : MY_ENV

    Variable value : C:\Windows

    I am able to launch notepad from Run command using the command "%MY_ENV%\notepad.exe"

    But unable to launch using the C# code 

    Process.Start(@"%MY_ENV%\notepad.exe");

    Thanks in advance!

    Wednesday, February 6, 2019 10:30 AM

Answers

  • Try this too:

       Process.Start(Environment.ExpandEnvironmentVariables(@"%MY_ENV%\notepad.exe"));

    • Marked as answer by Joy123456 Wednesday, February 6, 2019 12:14 PM
    Wednesday, February 6, 2019 12:06 PM

All replies