Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ path(CMD) — OpenDesktop 3.0.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought


 path(CMD)                       19 June 1992                       path(CMD)


 Name

    path - set a search path for executable files

 Syntax


    path [[drive:]path[;...]]

    To display the current search path, use the following syntax:

    path

    To clear all search-path settings other than the default setting (the
    current directory), use the following syntax:

    path ;


 Description

    MS-DOS uses the path command to search for executable files in the direc-
    tories you specify.  By default, the search path is the current directory
    only.

 Parameters


    [drive:]path
                Specifies a drive, directory, and any subdirectories to
                search.

    ;           When used as the only parameter, clears all search-path set-
                tings and specifies that MS-DOS is to search only the current
                directory.


 Notes


    Current directory

    MS-DOS always searches in the current directory first, before it searches
    directories in the search path.

    Length limit for the path command

    The maximum length of the path command is 127 characters.  To fit more
    directories in the search path, you can shorten directory names, use the
    subst command to redirect directories to logical drives (which shortens
    the entries on the path command line), or use the append /x:on command.

    Files with the same name, different extensions

    You might have some files in the same directory that share the same
    filename 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 system to the accounting system net-
    work.

    MS-DOS searches for a file by using default filename extensions in the
    following order of precedence: .COM, .EXE, and .BAT.  To run ACCNT.BAT
    when ACCNT.COM exists in the same directory, you must include the .BAT
    extension on the command line.

    Two or more identical filenames in the path

    You might have two or more files in the search path that have the same
    filename and extension.  MS-DOS searches for the specified filename first
    in the current directory, then it searches directories in the order in
    which they are listed in the path command.

    Specifying multiple paths

    To specify more than one path for MS-DOS to search, separate entries with
    a semicolon (;).

    Using path in your AUTOEXEC.BAT file

    If you place the path command in your AUTOEXEC.BAT file, MS-DOS automati-
    cally initiates the specified search path every time you start your com-
    puter.

 Example

    The following command specifies that MS-DOS is to search three direc-
    tories to find external commands (the three paths for these directories
    are C:\USER\TAXES, B:\USER\INVEST, and B:\BIN):

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


 Related command

    For information about setting a search path for data files, see the
    append command.


Typewritten Software • bear@typewritten.org • Edmonds, WA 98026