Question
· Oct 15, 2025

How to get the correct USERPROFILE Windows environment variable in Caché ObjectScript please?

$System.Util.GetEnviron("USERPROFILE") returns "C:\WINDOWS\system32\config\systemprofile". I don't know what that is, but that folder doesn't even exist. The correct value which I need is "C:\Users\robert.steed", as seen via the Windows command line "set" command.

Product version: Caché 2018.1
$ZV: Cache for Windows (x86-64) 2018.1.7 (Build 721U) Fri Mar 18 2022 22:07:35 EDT
Discussion (5)2
Log in or sign up to continue

What account is Caché running under? You'll need to review Windows Services to find the Caché service controller (I don't remember the exact name). It's probably running under the Local System account; you'll need to change it to log on with your own credentials if you want it to use your account's environment.