Here are three ways you can set the user environment variable FOO
with the value path\to\foo
so that the variable persists across sessions.
- Using the command prompt:
setx FOO "path\to\foo"
- Using powershell:
[Environment]::SetEnvironmentVariable("FOO", "path\to\foo", [System.EnvironmentVariableTarget]::User)
- Using the windows GUI.
- Open the start menu.
- Search for the "Advanced System Settings" control panel and click on it.
- Click on the "Environment Variables" button toward the bottom of the screen.
- Follow the prompts to add the variable to the user table.