PATH Variable

The PATH is a system variable in Linux, DOS, and Microsoft Windows and other operating systems that specifies a set of directories where executable programs are located. In general, each executing process or user session has its own PATH setting.

The PATH variable information is used to locate executable from the command line interface (CLI), also known as Terminal (or command prompt) window.

PATH on Windows
The PATH variable is specified as a list of one or more directory names separated by semicolon character.

When a command is entered in a command shell or a system call is made by a program to execute a program, the Windows first searches the current working directory and then searches the PATH, examining each directory from left to right, looking for an executable filename that matches the command name given. Executable programs have filename extensions of EXE or COM, and batch scripts have extensions of BAT or CMD. Other executable filename extensions can be registered with the system as well.

Windows XP
C:\WINDOWS\system32; C:\WINDOWS\; C:\Program Files\BitNami WAMPStack\php; C:\Program Files\BitNami WAMPStack\php\ext; C:\Program Files\TortoiseSVN\bin; C:\Program Files\BitNami WAMPStack\mysql\bin; C:\Program Files\Graphviz2.26.3\bin; C:\Program Files\doxygen\bin
 * 1) Start -> Control Panel -> System -> Advanced
 * 2) Click on Environment Variables, under System Variables, find PATH, and click on it.
 * 3) In the Edit windows, modify PATH by adding the full path of the directory in which there is an executable you want to run or call. If you do not have the item PATH, you may select to add a new variable and add PATH as the name and the location of the directory of interest as the value. For example, a PATH variable could have the following content (all on the same, very long line!):
 * 1) Close the window.
 * 2) Reopen Command prompt window, and run your executable or scripts.

Windows Vista and 7

 * 1) Right click “My Computer” icon
 * 2) Choose “Properties” from context menu.
 * 3) Click “Advanced” tab (“Advanced system settings” link in Vista)
 * 4) In the Edit windows, modify PATH by adding the full path of the directory in which there is an executable you want to run or call. If you do not have the item PATH, you may select to add a new variable and add PATH as the name and the location of the directory of interest as the value.
 * 5) Reopen Command prompt window, and run your executable or scripts.