Movatterモバイル変換


[0]ホーム

URL:


Skip to main content

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft EdgeMore info about Internet Explorer and Microsoft Edge
Table of contentsExit editor mode

path

Feedback

In this article

Sets the command path in the PATH environment variable, specifying the set of directories used to search for executable (.exe) files. If used without parameters, this command displays the current command path.

Syntax

path [[<drive>:]<path>[;...][;%PATH%]]path ;

Parameters

ParameterDescription
[<drive>:]<path>Specifies the drive and directory to set in the command path. The current directory is always searched before the directories specified in the command path.
;Separates directories in the command path. If used without other parameters,; clears the existing command paths from the PATH environment variable and directs Cmd.exe to search only in the current directory.
%PATH%Appends the command path to the existing set of directories listed in the PATH environment variable. If you include this parameter, Cmd.exe replaces it with the command path values found in the PATH environment variable, eliminating the need to manually enter these values at the command prompt.
/?Displays help at the command prompt.

Remarks

  • The Windows operating system searches using default file name extensions in the following order of precedence: .exe, .com, .bat, and .cmd. Which means if you're looking for a batch file named, acct.bat, but have an app named acct.exe in the same directory, you must include the .bat extension at the command prompt.

  • If two or more files in the command path have the same file name and extension, this command first searches for the specified file name in the current directory. Then, it searches the directories in the command path in the order that they're listed in the PATH environment variable.

  • If you place thepath command in your Autoexec.nt file, the Windows operating system automatically appends the specified MS-DOS subsystem 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

To search the pathsc:\user\taxes,b:\user\invest, andb:\bin for external commands, type:

path c:\user\taxes;b:\user\invest;b:\bin

Related links


Feedback

Was this page helpful?

YesNoNo

Need help with this topic?

Want to try using Ask Learn to clarify or guide you through this topic?

Suggest a fix?

  • Last updated on

In this article

Was this page helpful?

YesNo
NoNeed help with this topic?

Want to try using Ask Learn to clarify or guide you through this topic?

Suggest a fix?