0

I don't remember how exactly, but I had set up an environmental variable on Windows. This is not inside the Windows advanced settings -> Environmental Variables.

I have tried to unset it in many ways including, from git-bash:

$ unset DUMMY
$ env | grep DUMMY

This works only for the current session. When I restart or open a new terminal I can still see the variable set. I also tried to unset it from PowerShell as follows:

$ Remove-Item Env:\DUMMY

But like the previous technique, this is only for the current session. How can I find where this environmental variable is being loaded?

PS: To clarify, this is an environment variable that I created myself some weeks ago, but I forgot where/how I had set it to stay persistent.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
James
  • 3,597
  • 11
  • 41
  • 76
  • 1
    Possibly answered here: https://stackoverflow.com/questions/13222724/command-line-to-remove-an-environment-variable-from-the-os-level-configuration – timl Oct 08 '18 at 14:54
  • 2
    If the variable is not among the system or user environment variables you probably added the variable definition to a [PowerShell profile](http://blogs.technet.com/b/heyscriptingguy/archive/2012/05/21/understanding-the-six-powershell-profiles.aspx). Another possible location might be a [`.bash_profile`](https://stackoverflow.com/a/38385930/1630171) in your Git home, but then the variable shouldn't be showing up in a PowerShell console. – Ansgar Wiechers Oct 08 '18 at 15:59
  • @timl you are right... I had set it using the `setx` command and therefore the solution in the link you provided, has worked perfectly. Thanks – James Oct 08 '18 at 16:02

0 Answers0