Wednesday, October 3

Setting Path

PATH
The PATH command sets permanent search path to a specified directory.
  • MS-DOS will look for program having extension COM, EXE, BAT in the path specified (to execute such files
  • PATH on its own, displays the search path.
  • Even if a permanent search paths is set, the operating system first looks in the current directory and then successively in the directories in the search path.
  • Permanent path remains active as long as the computer is switched On or until you remove the path.
Syntax
PATH : Path, the command with out any parameter displays the currently active search path.
[drive] : The drive to be searched.
path    : The path (or name) of the directories and sub directories to be searched.

Example 1
C:CLASS9>PATH =C:\WP51  (press enter key)
- if you type WP at C:\CLASS9> and (press enter key)
(i.e. C:\CLASS9>WP press enter key)
DOS will search the WP.EXE file in the directory wp51 and then execute it.
Example 2
C:\>PATH = A:\DBASE (press enter key)
It sets search PATH to directory dBASE of A: drive from the C: drive.
Example 3
C:\>PATH =C:\GWBASIC ; C:\WP51 ; C:\LOTUS (press enter key)
It sets search Path to directories GWBASIC,WP51, LOTUS
Path for two directories is separated by a semi colon(;)
Note : Search Path can be permanently specified in the AUTOEXEC.BAT file. 

No comments:

Post a Comment