Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am looking for prove or disprove of my theory. We have windows service which runs under LocalSystem account. the service is calling msbuild and builds csproj (Visual Studio project) file, which use Environment variable. But its falling as it cant recognize or find that environment variable.

Is there way how I can test or assure that win service running under LocalSystem has access to environment variables?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

If your environment variables are changing and you're running the service (as LocalSystem) in Windows Server 2003, XP, or 2000 then you might be running into the case that you need to restart the machine in order for the service manager to reread the environment. See this KB article for more info.

There's a hotfix available for Windows Server 2003 that will resolve this.

share|improve this answer
1  
thanks for tip. Restarting helped. Any idea if the same applies to windows server 2008? –  Jaroslav Urban Jul 21 '11 at 9:28

Programs running as LocalSystem will have an environment built from the variables specified at "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" and at "HKEY_USERS.DEFAULT\Environment". Make sure the variables you want it to "see" are defined in one of those locations and they will be accessible.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.