i saw this
link for questions on the
setx command. Having just worked that out myself, i thought that i would share what i have learned. The OP has over 15,000 views at time of this writing, so there is much interest in this command and how it works.
the first question about rebooting, no it is not necessary to reboot. it just has to do with an understanding of what the
setx command is doing at runtime. by running
setx variablename path, what you are doing is setting a global environment variable for all
future dos windows but
not the current one!
The solution for bobritter is to run the following command at runtime:
setx variablename path &
set variablename=
path. An example might be:
setx returnvalue %cd% &
set returnvalue=
%cd%
What this is doing is setting (via
setx) all future environment variables as well as the local (via the
set command) one too. This should fix the rebooting issue as well as answer squashman as to what the command is doing.
The
setx command does lots of other things, type in
setx by itself to display the help menu.
Hope that this helps out other users of this command. If anyone has other questions about this command, please ask away...
CM
