the extrage thing is that I’m running a CMD with the SET command, and I can see the variable.
But the robot cannot see it.
I also tried to see all the variables with a loop over the System.Environment.GetEnvironmentVariables, and there are some others variables that I can not se besides the CLIENTNAME, like the SESSIONNAME.
But I can see them with the SET command in CMD.
All of the above works perfectly manually, one of the above works.
The problem is as follows:
The Service Mode Robot Service (SCM-managed)** (UiPath.Service.Host.exe), Runs under the Local System.
Hence, the Local System cannot access directly to the Environmetn Variable CLIENTNAME.
Because this variable is saved in the Registry under the User’s Volatile Environment variables.
In orther for us the get the value of a User Env. Variable, we need to Query de registry either by powershell or cmd script, and get the value.