Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/tfs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows路径中的短名称_Windows - Fatal编程技术网

Windows路径中的短名称

Windows路径中的短名称,windows,Windows,在一些批处理脚本中,我看到“C:\Oracle\MIDDLE~1”用于表示路径“C:\Oracle\Middleware”。我想知道为什么这个缩写,以及“MIDDLE~1”和“Middleware”之间的映射存储在Windows中的哪个位置。您能提供帮助吗?短文件名由windows自动生成,以便与基于MS-DOS的旧程序或16位程序兼容,这些程序要求所有文件名采用8.3格式,即8个符号表示名称,3个符号表示扩展名。有关如何从长文件名生成短文件名的详细信息,请参见此处:这是微软管理长文件名的方法

在一些批处理脚本中,我看到“C:\Oracle\MIDDLE~1”用于表示路径“C:\Oracle\Middleware”。我想知道为什么这个缩写,以及“MIDDLE~1”和“Middleware”之间的映射存储在Windows中的哪个位置。您能提供帮助吗?

短文件名由windows自动生成,以便与基于MS-DOS的旧程序或16位程序兼容,这些程序要求所有文件名采用8.3格式,即8个符号表示名称,3个符号表示扩展名。有关如何从长文件名生成短文件名的详细信息,请参见此处:

这是微软管理长文件名的方法

摘录:

Long filenames (LFN), are Microsoft's way of implementing filenames longer than 
the 8.3 filename, or short-filename, naming scheme used in Microsoft DOS in their
modern FAT and NTFS filesystems. Because these filenames can be longer than an 
8.3 filename, they can be more descriptive. Another advantage of this scheme is 
that it allows longer extensions common on other operating systems (e.g. .jpeg, 
.tiff, .html, and .xhtml) rather than specialized shortened names (e.g. .jpg, 
.tif, .htm, .xht). The first Microsoft Windows operating system to implement 
long filenames on FAT was Windows NT 3.5 in 1994.

The long filename system allows a maximum length of 255 UTF-16 characters,
including spaces and non-alphanumeric characters (excluding the following 
characters, which have special meaning within the command interpreter or the 
operating system kernel: \ / : * ? " < > |). 
This is achieved by chaining up to 20 directory entries of 13 2-byte unicode 
characters each.

To maintain compatibility with older operating systems, Microsoft formulated a 
method of generating an 8.3 filename from the long filename (for example, 
"Microsoft.txt" to "MICROS~1.TXT") and associating it with the file.
长文件名(LFN),是微软实现文件名长度超过
Microsoft DOS在其应用程序中使用的8.3文件名或短文件名命名方案
现代FAT和NTFS文件系统。因为这些文件名可以比
8.3文件名,它们可以更具描述性。这个计划的另一个优点是
它允许在其他操作系统(例如jpeg、,
.tiff、.html和.xhtml),而不是专门的缩写名称(例如.jpg、,
.tif、.htm、.xht)。第一个实现的Microsoft Windows操作系统
FAT上的长文件名在1994年是WindowsNT3.5。
长文件名系统允许最大长度为255个UTF-16字符,
包括空格和非字母数字字符(不包括以下字符)
在命令解释器或
操作系统内核:\/:*?“<>|”)。
这是通过链接多达20个13个2字节unicode的目录条目来实现的
每个字符。
为了保持与旧操作系统的兼容性,微软制定了
从长文件名生成8.3文件名的方法(例如,
并将其与文件关联。

谢谢,我理解了这一部分。但是,如果我需要从缩写形式中获取完整的文件名,我该如何获取?(在给定的示例中,我可以猜测,但不能总是这样做)例如,您可以使用powershell脚本从short.Run命令行获取完整的路径名:powershell-command“[System.IO.path]::GetFullPath(\“C:\\PROGRA~2\\desktop.ini\”;“指向MS支持的链接已失效。更新的失效链接。”