绝对路径

是从盘符开始的路径,形如

C:\windows\system32\cmd.exe

相对路径

是从当前目录开始的路径,假如当前目录为C:\windows

要描述上述路径,只需输入

system32\cmd.exe

实际上,严格的相对路径写法应为

.\system32\cmd.exe

其中,.表示当前目录,在通常情况下可以省略,只有在特殊的情况下不能省略。

假如当前目录为c:\program files

要描述上述路径,则需要输入

..\windows\system32\cmd.exe

其中,..表示父目录。指的是当前目录的上一级目录 。

当前目录如果为c:\program files\common files

要描述上述路径,则需要输入

..\..\windows\system32\cmd.exe

另外,还有一种不包含盘符的特殊绝对路径,例如,下面写法表示上述路径

\windows\system32\cmd.exe

无论当前目录是什么,会自动地从当前盘的根目录开始查找指定的程序。

相关文章:

  • 2021-11-22
  • 2021-09-02
  • 2021-12-04
  • 2022-12-23
  • 2021-11-17
  • 2021-09-28
  • 2021-11-01
猜你喜欢
  • 2021-09-17
  • 2021-12-21
  • 2022-12-23
  • 2022-01-11
  • 2022-12-23
  • 2022-02-24
  • 2022-12-23
相关资源
相似解决方案