469,950 Members | 1,808 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,950 developers. It's quick & easy.

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?

Mar 14 '06 #1
2 1977
<fd*****@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

Mar 14 '06 #2
It is a system variable. It was originally a user variable, so I
switched to system variable, but with no better results.

Mar 14 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by SP | last post: by
reply views Thread by François Lemaire | last post: by
1 post views Thread by Scott Davies | last post: by
reply views Thread by Scott Davies | last post: by
6 posts views Thread by Nikolay Petrov | last post: by
4 posts views Thread by tshad | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.