|
cadle
初级用户
 
积分 195
发帖 49
注册 2005-8-12 来自 辽宁
状态 离线
|
『楼 主』:
[新手求助]PATH的理解与用法!
使用 LLM 解释/回答一下
对PATH命令不是太理解,也不怎么会用,请各位不吝赐教,多谢!最好详细点……
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...
|
|
2005-9-2 08:34 |
|
|
fdsiuha
高级用户
    闷
积分 587
发帖 302
注册 2005-7-25
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
PATH是指定搜索程序路径的命令
比如你的WPS.com文件放在C:\UCDOS下,你想在任何时候都能立即输入WPS启动WPS处理文本,那么,就需要事先告诉DOS,可以在那些目录下找到WPS.COM这个文件。那么就应该在电脑启动的时候输入 PATH C:\UCDOS或者 SET PATH=C:\UCDOS.另外还可以在AUTOEXEC.BAT文件中添加这个命令,这样不用每次启动的时候输入一遍了.
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.
|

欢迎造访DOS的小屋!
http://risky.ik8.com |
|
2005-9-2 19:15 |
|
|
chujiafu
银牌会员
    
积分 1339
发帖 595
注册 2004-5-26 来自 安徽 宿州
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
Dos命令分为两种:一种是内部命令,一种是外部命令。内部命令在Dos的必备文件Command.com中,外部命令是以和此外部命令同名的文件的形式放在磁盘上(软盘、硬盘或光盘)。当你打入一个命令时,Dos首先在Command.com中寻找它,找到之后就执行;如果在Command.com中找不到,就在当前目录中寻找,如果在当前目录中也找不到,就在你指定的搜索路径中寻找,如果还找不到,就会显示“Bad command or file name(错误的命令或文件名),这是我们在Dos下见到的最常见的错误提示信息。在Dos下,有三种文件可以被执行。这三种文件的扩展名分别是:.com、.exe、.bat。比如,当前目录是A:\,在A:\hd下有一个可执行文件Tw.exe,因为当前目录是A:\,所以当你打入Tw时(Dos命令不用打入扩展名),Dos首先Command.com中寻找Tw,看它是不是内部命令,(当然找不到,因为Tw不是内部命令),然后在当前目录(也就是A:\)下寻找Tw,当前目录是A:\,在A:\下没有Tw(Tw在A:\hd中)。这时,如果你没有用Path设置可执行文件的搜索路径的话,Dos就会显示”Bad command or file name“。如果你用了Path=A:\;A:\hd的话,当Dos在当前目录(即A:\)下没有找到Tw时,它就会按照你指定的搜索路径(本例是A:\hd)中寻找Tw,因为你已指定了搜索路径,所以它会执行Tw,而不会显示“Bad command or file name”了。又如,当前目录是C:\,当你打入Tw时,Dos首先在Command.com寻找Tw,找不到就在当前目录下(当前目录是C:\)寻找Tw,找不到就按你设置的路径A:\和A:\hd下寻找Tw,找到了就执行,找不到就显示“Bad command or file name”。综上,Path命令就是给可执行文件设置搜索路径,让你无论在哪一个目录下(也就是只要了出现Dos提示符)都可以执行命令,而不必进入到这个目录。而Path本身是一个内部命令。
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.
|
|
2005-9-3 10:34 |
|
|
cadle
初级用户
 
积分 195
发帖 49
注册 2005-8-12 来自 辽宁
状态 离线
|
|
2005-9-5 08:23 |
|
|
lvyang
初级用户
 
积分 126
发帖 6
注册 2003-6-2
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
PATH命令有路径个数限制吗?我在PATH命令中最多能设定多少路径?
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?
|
|
2006-3-12 15:48 |
|
|
Michael
钻石会员
       
积分 10046
发帖 3039
注册 2002-11-11
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
我还没遇到过path的个数限制,但path的长度限制却是有的。
I haven't encountered a limit on the number of paths, but there is a limit on the length of paths.
|

简单就是美 |
|
2006-3-12 21:52 |
|
|
gxblgb
初级用户
 
积分 75
发帖 36
注册 2006-2-8
状态 离线
|
|
2006-3-15 20:49 |
|
|
lihuanfa
新手上路

积分 8
发帖 4
注册 2006-3-16
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
三楼解释得好详细,学习了
The explanation on the third floor is very detailed, I've learned it.
|
|
2006-3-16 21:49 |
|
|
wl00560
银牌会员
    
积分 1384
发帖 709
注册 2005-10-29
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
问一下,如果在autoexec.bat中不要windows98的默认path,而要加上自己的新path,应该怎么做?
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?
|
|
2006-3-16 21:52 |
|
|
DOSforever
金牌会员
     
积分 4639
发帖 2239
注册 2005-1-30
状态 离线
|
|
2006-3-17 13:03 |
|
|
wl00560
银牌会员
    
积分 1384
发帖 709
注册 2005-10-29
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
Originally posted by DOSforever at 2006-3-17 13:03:
2楼的已经先于你的问题回答了
没有啊,我是说要 取消默认路径,如c:\windows等,再加上自己的路径啊
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.
|
|
2006-3-17 18:15 |
|
|
Michael
钻石会员
       
积分 10046
发帖 3039
注册 2002-11-11
状态 离线
|
『第 12 楼』:
使用 LLM 解释/回答一下
新设置的路径会覆盖原来的路径设置。
The newly set path will overwrite the original path settings.
|

简单就是美 |
|
2006-3-17 18:24 |
|
|
wl00560
银牌会员
    
积分 1384
发帖 709
注册 2005-10-29
状态 离线
|
『第 13 楼』:
使用 LLM 解释/回答一下
不会,新的路径会加在默认路径之后,你可以自己试一下。默认路径始终在那儿
No, the new path will be added after the default path, you can try it yourself. The default path is always there
|
|
2006-3-18 15:02 |
|
|
kingchain
初级用户
 
积分 133
发帖 57
注册 2006-3-15
状态 离线
|
|
2006-3-19 20:04 |
|
|
fdsiuha
高级用户
    闷
积分 587
发帖 302
注册 2005-7-25
状态 离线
|
『第 15 楼』:
使用 LLM 解释/回答一下
Originally posted by wl00560 at 2006-3-18 15:02:
不会,新的路径会加在默认路径之后,你可以自己试一下。默认路径始终在那儿
那个可能是你在 Windows 下使用DOS的原因吧。Windows 有自己的环境变量。需要在Winodws下修改。
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.
|

欢迎造访DOS的小屋!
http://risky.ik8.com |
|
2006-3-20 13:39 |
|