Reading an Environment Variable that has changed

We’ve got an interesting problem related to environment variables. We’ve got a bot that is getting (windows) environment variables as part of the process. However, during the login, startup scripts run that set and change some of those environment variables.

When stopping the process, we see the correct environment variables in the windows environment, but the variables are unchanged (pre-login script values) in UIPath.

This implies that environment variables are cached upon login. Not sure if that’s true or not. Has anyone else experienced this issue, and do you have any suggestions on workarounds? Can we refresh cached environment variable values in the bot code, or delay the reading of these variables until after the logon scripts have run?

Esoteric topic, I know. Any thoughts?

Thank you.

Hi Patrick,

Found an solution in the below discussion. Kill the UiPath.Service.host in the task manager.Then it will be refreshed.

I know its very late,but for the sake of other readers.

1 Like