Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why setx command does not set an user variable?

I want to add an user variable using setx. I tried:

setx LOL abcd

> SUCCESS: Specified value was saved

echo %LOL%

> %LOL%

Why it does not set an user variable? I expected:

echo %LOL%

> abcd 
like image 260
mpr Avatar asked Oct 26 '25 22:10

mpr


1 Answers

Why setx command does not set an user variable?

Because that is the way it works.

setx will change the environment variable you specify for future sessions. Use set to set for the current and new child processes.

like image 186
Richard Avatar answered Oct 30 '25 11:10

Richard



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!