中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-13 19:18
47,811 topics / 349,897 posts / today 0 new / 48,256 members
DOS学习入门 & 精彩文章 (教学室) » [Newbie Seeking Help] Understanding and Usage of PATH!
Printable Version  4,469 / 24
Floor1 cadle Posted 2005-09-02 08:34
初级用户 Posts 49 Credits 195 From 辽宁
I don't quite understand the PATH command and don't know how to use it well. Please be so kind as to give me your advice. Thanks! It's better to be detailed...
Floor2 fdsiuha Posted 2005-09-02 19:15
高级用户 Posts 302 Credits 587
PATH is a command to specify the search path for programs. For example, if your WPS.com file is placed in C:\UCDOS, and you want to be able to immediately type WPS to start WPS to process text at any time, then you need to tell DOS in advance in which directories the WPS.COM file can be found. Then you should enter PATH C:\UCDOS or SET PATH=C:\UCDOS when the computer starts. Additionally, you can add this command in the AUTOEXEC.BAT file, so you don't need to type it every time you start up.
Floor3 chujiafu Posted 2005-09-03 10:34
银牌会员 Posts 595 Credits 1,339 From 安徽 宿州
DOS commands are divided into two types: one is internal commands, and the other is external commands. Internal commands are in the essential file Command.com of DOS. External commands are placed on the disk (floppy disk, hard disk or CD - ROM) in the form of files with the same name as the external commands. When you type in a command, DOS first looks for it in Command.com, and executes it after finding it; if it is not found in Command.com, it looks in the current directory; if it is not found in the current directory, it looks in the search path you specified; if it is still not found, it will display "Bad command or file name", which is the most common error prompt message we see under DOS. Under DOS, there are three types of files that can be executed. The extensions of these three types of files are:.com,.exe,.bat. For example, the current directory is A:\, and there is an executable file Tw.exe in A:\hd. Because the current directory is A:\, when you type in Tw (you don't need to type in the extension for DOS commands), DOS first looks for Tw in Command.com to see if it is an internal command. (Of course, it can't be found because Tw is not an internal command). Then it looks for Tw in the current directory (that is, A:\). The current directory is A:\, and there is no Tw in A:\ (Tw is in A:\hd). At this time, if you haven't set the search path of executable files with Path, DOS will display "Bad command or file name". If you use Path = A:\; A:\hd, when DOS doesn't find Tw in the current directory (that is, A:\), it will look for Tw in the search path you specified (in this example, A:\hd). Because you have specified the search path, it will execute Tw and won't display "Bad command or file name". Another example: the current directory is C:\, when you type in Tw, DOS first looks for Tw in Command.com, if not found, it looks for Tw in the current directory (current directory is C:\), if not found, it looks for Tw in the set paths A:\ and A:\hd, if found, it executes it, if not found, it displays "Bad command or file name". In conclusion, the Path command is to set the search path for executable files, so that you can execute commands no matter in which directory (that is, as long as the DOS prompt appears) without having to enter into this directory. And Path itself is an internal command.
Floor4 cadle Posted 2005-09-05 08:23
初级用户 Posts 49 Credits 195 From 辽宁
Thanks! Learning...
Floor5 lvyang Posted 2006-03-12 15:48
初级用户 Posts 6 Credits 126
Does the PATH command have a limit on the number of paths? What is the maximum number of paths I can set in the PATH command?
Floor6 Michael Posted 2006-03-12 21:52
钻石会员 Posts 3,041 Credits 10,056
I haven't encountered a limit on the number of paths, but there is a limit on the length of paths.
Floor7 gxblgb Posted 2006-03-15 20:49
初级用户 Posts 36 Credits 75
Floor8 lihuanfa Posted 2006-03-16 21:49
新手上路 Posts 4 Credits 8
The explanation on the third floor is very detailed, I've learned it.
Floor9 wl00560 Posted 2006-03-16 21:52
银牌会员 Posts 709 Credits 1,384
Ask, if you don't want the default path of Windows 98 in autoexec.bat and want to add your own new path, how should you do it?
Floor10 DOSforever Posted 2006-03-17 13:03
金牌会员 Posts 2,239 Credits 4,639
Originally posted by wl00560 at 2006-3-16 21:52:
Ask, if in autoexec.bat, do not want the default path of Windows 98, but want to add their own new path, how should it be done?

The second floor has already answered your question earlier
Floor11 wl00560 Posted 2006-03-17 18:15
银牌会员 Posts 709 Credits 1,384
Originally posted by DOSforever at 2006-3-17 13:03:

The user on the 2nd floor has already answered your question earlier.

No, I mean to cancel the default path, such as c:\windows, etc., and then add my own path.
Floor12 Michael Posted 2006-03-17 18:24
钻石会员 Posts 3,041 Credits 10,056
The newly set path will overwrite the original path settings.
Floor13 wl00560 Posted 2006-03-18 15:02
银牌会员 Posts 709 Credits 1,384
No, the new path will be added after the default path, you can try it yourself. The default path is always there
Floor14 kingchain Posted 2006-03-19 20:04
初级用户 Posts 57 Credits 133
Floor15 fdsiuha Posted 2006-03-20 13:39
高级用户 Posts 302 Credits 587
Originally posted by wl00560 at 2006-3-18 15:02:
No, the new path will be added after the default path, you can try it yourself. The default path is always there


That might be because you are using DOS under Windows. Windows has its own environment variables. You need to modify it under Windows.
1 2  Next
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023