How do I reload Windows environment variables in Cygwin without rebooting?

0

0

Note: this is a follow-up question to this answer.

I updated my PATH environment variable using Windows 7's Environment Variables dialogue.

However, it seems that the only way to get Cygwin to pull the updated PATH is to reboot my machine, which is obviously far from an ideal solution, and plain problematic for server users.

Is it possible to get Cygwin to see updated Windows environment variables without rebooting the machine?

Hashim

Posted 2017-10-26T23:18:47.573

Reputation: 6 967

which environment variables ? How do you updated them ? – matzeri – 2017-10-27T20:46:18.430

@matzeri The details are in the original question, but I changed the PATH system environment variable from within Windows 7 the usual way - by searching and opening "Edit the system environment variables" and clicking the "Environment variables" button. – Hashim – 2017-10-27T20:49:04.797

Answers

0

If you're updating Windows environment variables, you should be able to restart the Cygwin window and see the updated environment.

Alternatively, you can use Cygwin environment variables like:

export TEST_VARIABLE=value

Now the $TEST_VARIABLE will "value" you can confirm this by:

echo $TEST_VARIABLE
value

This should show you the above output.

sfali16

Posted 2017-10-26T23:18:47.573

Reputation: 1