GetEnvironmentVariable in Windows Service

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • fdmaxey@yahoo.com

    #1

    GetEnvironmentVariable in Windows Service

    I've written code in VB.Net that calls GetEnvironmentV ariable. When I
    execuate the code as part of a Windows Form, it reads the environment
    variable with no problem.

    I put the code in a Windows Service, however, and it can't seem to read
    the same environment variable.

    I used Microsoft .Net Framework to give the application every possible
    permission, but it doesn't seem to help.

    Ideas?

  • Armin Zingler

    #2
    Re: GetEnvironmentV ariable in Windows Service

    <fdmaxey@yahoo. com> schrieb[color=blue]
    > I've written code in VB.Net that calls GetEnvironmentV ariable. When
    > I execuate the code as part of a Windows Form, it reads the
    > environment variable with no problem.
    >
    > I put the code in a Windows Service, however, and it can't seem to
    > read the same environment variable.
    >
    > I used Microsoft .Net Framework to give the application every
    > possible permission, but it doesn't seem to help.
    >
    > Ideas?[/color]


    Is it a user specific environment variable, or a system variable?

    Control panel -> System: Folder "extended" -> Button "Environmen t variables"

    The service is usually running under a different account.


    Armin

    Comment

    • fdmaxey@yahoo.com

      #3
      Re: GetEnvironmentV ariable in Windows Service

      It is a system variable. It was originally a user variable, so I
      switched to system variable, but with no better results.

      Comment

      Working...