I just checked out the environment variable thing in Vista. It returns a completely different path!
Result: "C:\ProgramData"
in Windows XP, the same code results in "C:\Documents and Settings\All Users", which as I said further up, is not a good place to be storing stuff.
Strict Extern "Win32" Function GetEnvironmentVariable(lpName$z, lpBuffer:Byte Ptr, nSize) = "GetEnvironmentVariableA@12" End Extern Print GetEnv("ALLUSERSPROFILE") End Function GetEnv$(envVar$) Local buff@[64] Local rtn = GetEnvironmentVariable(envVar$, buff@, buff.length) If rtn > buff.length buff@ = buff@[..rtn] rtn = GetEnvironmentVariable(envVar$, buff@, buff.length) EndIf Return string.FromBytes(buff@, rtn) End Function
Result: "C:\ProgramData"
in Windows XP, the same code results in "C:\Documents and Settings\All Users", which as I said further up, is not a good place to be storing stuff.