Dos: Adding commands to the PATH

By Eric Downing. Filed in OS, Shell, Windows  |  
TOP del.icio.us digg

When you install a new piece of software that does not add itself to the Windows PATH variable, you may find your self
needing it to be run from a command prompt. You could type the full command path each time you run the executable, but
it may be easier to add the directory to the PATH variable so that it is always available.

To add it for the current command prompt:

set PATH=%PATH%;"C:Program FilesSometool"

This will add the variable to the current command prompt environment but will go away once you close the window and will not
be available to other prompts unless you type it in again.

To add it to the Windows Environment, you can use the My Computer->Properties menu to select the “Advanced System Settings”
in Windows 7 to then select the “Environment Variables…”. Now the choice you have is to add it to the System variables or
the User variables for.

If you choose the System varables you will be adding it to the system as a whole and any other user who logs in will have
the updated path. If you add it to the User variables, then it is only available to your user.

Whichever you choose, select the Path entry and click the “Edit…” button. This will pop up a dialog that will let
you add to the “Variable Value” entry. Now you will need to decide whether you want your new path at the beginning, end,
or somewhere in the middle. You might add it to the beginning if it is being used to override an existing command. You
may add to the end if there is no conflict with other installs. And finally, you may need to choose the middle if there
are some commands you need to override but others that need to be left alone.

Entries are separated by the semi-colon “;” character in DOS.

Tags: ,

Leave a Reply