We have an application that depends on the .NET framework and performs a check at startup to see if the framework is installed. On our client machines, this works fine, but on our servers that run Windows Server 2k3, the check fails. When we look at the environment variables, it correctly shows that the Windows directory is C:\Windows and we can see that .NET is correctly installed there, but the Windows API call (GetWindowsDirectory) from our application returns C:\Programs and Settings\[User Name]\Windows which is invalid and doesn't even exist. Is there something about Server 2k3 that would cause this kind of mis-reporting, or do I need to look elsewhere? Thanks.
You're better off reading from the SystemRoot environment variable instead of using the Windows API call. Try
If you're calling from native code