C# set environment variable May 30, 2023 by Tarik Unfortunately, you need to restart your process before environment variables can be refreshed. See this MSDN post.