Path
Updated: January 21, 2005
Syntax
Parameters
Remarks
- When used as the only parameter, ; deletes the existing command path value found in the PATH variable.
- When you include %path% in the syntax, Cmd.exe replaces it with the command path value found in the PATH variable, eliminating the need to manually enter these values at the command line. For more information about substituting environment variable values, see Command shell overview in Related Topics.
- The current directory is always searched first, before the directories in the command path.
- You might have some files in the same directory that share
the same file name but have different extensions. For example,
you might have a file named Accnt.com that starts an accounting
program and another file named Accnt.bat that connects your
server to the accounting system network.
The Windows Server 2003 family searches for a file by using default file name extensions in the following order of precedence: .exe, .com, .bat, and .cmd. To run Accnt.bat when Accnt.com exists in the same directory, you must include the .bat extension at the command line.
- If you have two or more files in the command path that have the same file name and extension, the Windows Server 2003 family searches for the specified file name first in the current directory, and then it searches the directories in the command path in the order in which they are listed in PATH.
- If you place the path command in your Autoexec.nt file, the Windows Server 2003 family automatically appends the specified MS-DOS subsystem search path to the search path every time you log on to your computer. Cmd.exe does not use the Autoexec.nt file. When started from a shortcut, Cmd.exe inherits the environment variables set in My Computer/Properties/Advanced/Environment.
Examples
path c:\user\taxes;b:\user\invest;b:\bin
Formatting legend
Format | Meaning |
Italic | Information that the user must supply |
Bold | Elements that the user must type exactly as shown |
Ellipsis (...) | Parameter that can be repeated several times in a command line |
Between brackets ([]) | Optional items |
Between braces ({}); choices separated by pipe (|). Example: {even|odd} | Set of choices from which the user must choose only one |
Courier font | Code or program output |