Skip to main content
edited body
Source Link
Frank Thomas
  • 36.4k
  • 3
  • 81
  • 102

I'm afraid it's not quite that simple. Environment variables are not limited by scope, as you suggest, but you are right that the lifetime of the value in the variable is different when comparing the verbs.

Setset modifies the current shell's (the window's) environment values, and the change is available immediately, but it is temporary. The change will not affect other shells that are running, and as soon as you close the shell, the new value is lost until such time as you run set again.

setx modifies the value permanently, which affects all future shells, but does not modify the environment of the shells already running. You have to exit the shell and reopen it before the change will be available, but the value will remain modified until you change it again.

See here for an example: http://batcheero.blogspot.com/2008/02/set-and-setx.html

I'm afraid it's not quite that simple. Environment variables are not limited by scope, as you suggest, but you are right that the lifetime of the value in the variable is different when comparing the verbs.

Set modifies the current shell's (the window's) environment values, and the change is available immediately, but it is temporary. The change will not affect other shells that are running, and as soon as you close the shell, the new value is lost until such time as you run set again.

setx modifies the value permanently, which affects all future shells, but does not modify the environment of the shells already running. You have to exit the shell and reopen it before the change will be available, but the value will remain modified until you change it again.

See here for an example: http://batcheero.blogspot.com/2008/02/set-and-setx.html

I'm afraid it's not quite that simple. Environment variables are not limited by scope, as you suggest, but you are right that the lifetime of the value in the variable is different when comparing the verbs.

set modifies the current shell's (the window's) environment values, and the change is available immediately, but it is temporary. The change will not affect other shells that are running, and as soon as you close the shell, the new value is lost until such time as you run set again.

setx modifies the value permanently, which affects all future shells, but does not modify the environment of the shells already running. You have to exit the shell and reopen it before the change will be available, but the value will remain modified until you change it again.

See here for an example: http://batcheero.blogspot.com/2008/02/set-and-setx.html

added 6 characters in body
Source Link
Frank Thomas
  • 36.4k
  • 3
  • 81
  • 102

I'm afraid it's not quite that simple. Environment variables are not limited by scope, as you suggest, but you are right that the lifetime of the value in the variable is different when comparing the verbs.

Set modifies the current shell's (windowthe window's) environment values, and the change is available immediately, but it is temporary. The change will not affect other shells that are running, and as soon as you close the shell, the new value is lost until such time as you run set again.

setx modifies the value permenantlypermanently, which affects all future shells, but does not modify the environment of the shells already running. You have to exit the shell and reopen it before the change will be available, but the value will remain modified until you change it again.

See here for an example: http://batcheero.blogspot.com/2008/02/set-and-setx.html

I'm afraid it's not quite that simple. Environment variables are not limited by scope, as you suggest, but you are right that the lifetime of the value in the variable is different when comparing the verbs.

Set modifies the current shell's (window) environment values, and the change is available immediately, but it is temporary. The change will not affect other shells that are running, and as soon as you close the shell, the new value is lost until such time as you run set again.

setx modifies the value permenantly, which affects all future shells, but does not modify the environment of the shells already running. You have to exit the shell and reopen it before the change will be available, but the value will remain modified until you change it again.

See here for an example: http://batcheero.blogspot.com/2008/02/set-and-setx.html

I'm afraid it's not quite that simple. Environment variables are not limited by scope, as you suggest, but you are right that the lifetime of the value in the variable is different when comparing the verbs.

Set modifies the current shell's (the window's) environment values, and the change is available immediately, but it is temporary. The change will not affect other shells that are running, and as soon as you close the shell, the new value is lost until such time as you run set again.

setx modifies the value permanently, which affects all future shells, but does not modify the environment of the shells already running. You have to exit the shell and reopen it before the change will be available, but the value will remain modified until you change it again.

See here for an example: http://batcheero.blogspot.com/2008/02/set-and-setx.html

I'm afraid itsit's not quite that simple. environmentEnvironment variables are not limited by scope, as you suggest, but you are right, that the lifetime of the value in the variable is different when comparing the verbs.

Set modifies the current shell's (window) environment values, and the change is available immediately, but it is temporary. the The change will not affect other shells that are running, and as soon as you close the shell, the new value is lost until such time as you run set again.

setx modifies the value permenantly, which affects all future shells, but does not modify the environment of the shells already running. you You have to exit the shell and reopen it before the change will be available, but the value will remain modified until you change it again.

seeSee here for an example: http://batcheero.blogspot.com/2008/02/set-and-setx.html

I'm afraid its not quite that simple. environment variables are not limited by scope, as you suggest, but you are right, the lifetime of the value in the variable is different when comparing the verbs.

Set modifies the current shell's (window) environment values, and the change is available immediately, but it is temporary. the change will not affect other shells that are running, and as soon as you close the shell, the new value is lost until such time as you run set again.

setx modifies the value permenantly, which affects all future shells, but does not modify the environment of the shells already running. you have to exit the shell and reopen it before the change will be available, but the value will remain modified until you change it again.

see here for an example: http://batcheero.blogspot.com/2008/02/set-and-setx.html

I'm afraid it's not quite that simple. Environment variables are not limited by scope, as you suggest, but you are right that the lifetime of the value in the variable is different when comparing the verbs.

Set modifies the current shell's (window) environment values, and the change is available immediately, but it is temporary. The change will not affect other shells that are running, and as soon as you close the shell, the new value is lost until such time as you run set again.

setx modifies the value permenantly, which affects all future shells, but does not modify the environment of the shells already running. You have to exit the shell and reopen it before the change will be available, but the value will remain modified until you change it again.

See here for an example: http://batcheero.blogspot.com/2008/02/set-and-setx.html

added 164 characters in body
Source Link
Frank Thomas
  • 36.4k
  • 3
  • 81
  • 102
Loading
Source Link
Frank Thomas
  • 36.4k
  • 3
  • 81
  • 102
Loading