1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

XP SETX Utility set global environment variable

Discussion in 'DOS/Other' started by ComputerMuse, Dec 1, 2011.

Thread Status:
Not open for further replies.
  1. ComputerMuse

    ComputerMuse Thread Starter

    Dec 1, 2011
    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 :D
  2. Squashman

    Squashman Trusted Advisor

    Apr 4, 2003
    Good job digging up a 4 1/2 year old thread. Of course it is going to have over 15,000 views after that amount of time. Half of those are probably just from Google Indexing this site a couple of times a day.

    I did not question as to what the command was doing. I just didn't know SETx was a command. It is not native to XP itself until you install the Support Tools. I don't know too many people who bother to install the support tools.
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1029223