PC Review Forums Newsgroups Microsoft DotNet Microsoft VB .NET GetEnvironmentVariable in Windows Service

Reply

GetEnvironmentVariable in Windows Service

 
Thread Tools Rate Thread
Old 14-03-2006, 05:49 PM   #1
fdmaxey@yahoo.com
Guest
 
Posts: n/a
Default GetEnvironmentVariable in Windows Service


I've written code in VB.Net that calls GetEnvironmentVariable. 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?

  Reply With Quote
Old 14-03-2006, 05:55 PM   #2
Armin Zingler
Guest
 
Posts: n/a
Default Re: GetEnvironmentVariable in Windows Service

<fdmaxey@yahoo.com> schrieb
> I've written code in VB.Net that calls GetEnvironmentVariable. 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?



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

Control panel -> System: Folder "extended" -> Button "Environment variables"

The service is usually running under a different account.


Armin

  Reply With Quote
Old 14-03-2006, 09:29 PM   #3
fdmaxey@yahoo.com
Guest
 
Posts: n/a
Default Re: GetEnvironmentVariable 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.

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off