Command: path

 Display or set the search path for executable files.

Syntax:

 1. PATH
 2. PATH [ '=' ] { path : ';' }
 3. PATH;

Options:

 PATH Displays the currently active search path.
 PATH= Assigns the specified paths to the search path.
 The leading equal sign, if present is ignored.
 PATH; Empties the search path.
 /? Shows the help

Comments:

 Displays or assigns a new search path.
 When FreeCOM searches for an external command or a batch script,
 which has no path specified, it is search for in all the directories
 specified in the search path. If the current directory . is not
 mentioned in the search path, it is searched through first.
 The paths of any frequently used programs can be put on the path list
 for convenience.
 When a program or external command is entered at the command prompt,
 FreeDOS looks for it in the current directory and then in each of the
 paths specified by the path command.
 If the same program name is in different path directories, the program
 will be started from the path which is first mentioned in the
 pathlist.
 PATH can also be used outside a batch file.
 PATH is a command internal to command.com and needs no other file
 in order to work.
 

Examples:

 Example 1:
 path C:\FREEDOS\BIN;C:\TOOLS;D:\OTHERS\BIN;BIN
 If FreeCOM is to execute an external program, e.g. XCOPY, FreeCOM
 will search for the program in the following directories in the
 specified order, the first program file found is executed:
 the current directory
 C:\FREEDOS\BIN
 C:\TOOLS
 D:\OTHERS\BIN
 BIN
 Note: Because the last directory specification is a relative one,
 rather than an absolute one, the program is searched for in the
 sub-directory BIN of the current directory.
 Example 2:
 IN A .BAT FILE / AUTOEXEC.BAT:
 path C:\FREEDOS\BIN;C:\UTIL
 path %path%;C:\GAMES
 This example adds C:\GAMES to the existing list, preserving the
 previously set paths. When you type path now the result is:
 path C:\FREEDOS\BIN;C:\UTIL;C:\GAMES

See also:

 autoexec.bat/fdauto.bat
 append
 command.com/freecom
 batch files

 Copyright © 2004 Robert Platt, updated 2011 and 2022 by W. Spiegl.
 This file is derived from the FreeDOS Spec Command HOWTO.
 See the file H2Cpying for copying conditions.

AltStyle によって変換されたページ (->オリジナル) /