Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Windows (https://www.askmehelpdesk.com/forumdisplay.php?f=237)
-   -   DOS set PATH command (https://www.askmehelpdesk.com/showthread.php?t=52652)

  • Jan 5, 2007, 10:34 PM
    mazeltov
    DOS set PATH command
    I used set PATH command to set the path as set PATH=c:/TC;and it works well
    However,some users adds %PATH% after it, what does it imply
  • Jan 5, 2007, 10:59 PM
    dmatos
    You can have multiple PATHs set at a single time. By saying:

    set PATH=c:/TC;

    the only path set is c:/TC. If you say:

    set PATH=c:/TC;%PATH%

    You are setting the path to c:/TC as well as all previous values of PATH. The percent signs denote an environment variable, which will be expanded to it's contents when the command is run. For example, say I type the following:

    set PATH=c:/bar;
    set PATH=c:/foo;%PATH%
    PATH
    > c:/foo;c:/bar
    set PATH=c:/foo;
    PATH
    > c:/foo;

    Make sense? You use this if you don't want to eliminate all of the other valid paths while setting a new one as well.
  • Jan 13, 2010, 07:23 AM
    francisdt
    Awesome explanation

  • All times are GMT -7. The time now is 10:52 AM.