the meaning of myconputer environment path

As we all know, the exe programes must run in their own folder, that is to say you must into the parent folder or write the absolute path. Should there is a way you can run them at any catalogue. The answer is "Path". 

The content of the environment variable "Path" are list of paths divided by ";". When the user command execute, system will first find the corresponding executable files under the current catalog and second under the paths in the "Path" variables if the user don't give the absolute path.

As to the environment variable "Path", the operating system do file search under all paths that the variable has. You can use the files under these paths only by the folder name, not additional path value. The reason is that the operating system can inspect the paths of the environment variable "Path".

Another suggestion is that, the "."(current catalog) should not a member in the "Path". It can cause the security questions. So if you want execute the command in the current catalog, the command should be "./program".

原文地址:https://www.cnblogs.com/lindsayzhao103011/p/2735249.html