Program Files 是Microsoft Windows 操作系统 中标准文件夹的目录名,通常安装不属于操作系统的应用程序 。通常, “Program Files”目录下安装的每个应用程序都会有一个用于存储其特定应用程序资源的子目录。共享资源(例如一个公司多个应用程序使用的资源)通常存储在“Common Files ”目录中。
位置
在标准Windows安装中,“Program Files”目录位于%SystemDrive%\Program Files(
或其本地化等效文件),而“Common Files”(或其本地化等效文件)将是“Program Files”下的子目录。在 Windows Vista 及更高版本中,“Program Files”和“Common Files”目录的路径未在磁盘上本地化(翻译)。相反,本地化名称是非本地化位置的NTFS符号链接 。此外,Windows shell 会根据系统的用户界面语言来显示Program Files文件夹名称的本地化。
“Program Files”和“Common Files”都可以移动。在系统启动时,“Program Files”和“Common Files”的实际路径从Windows注册表 加载,它们存储在HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion
下的ProgramFilesDir
和CommonFilesDir
值中。然后,系统的其余部分就可以通过易失性环境变量 %ProgramFiles%
和%CommonProgramFiles%
访问它们。应用程序还可以通过使用dirids
查询Setup API、
或通过Windows管理规范 、或通过使用CSIDL或ShellSpecialFolderConstants
查询shell来获取这些路径的位置。这些都是与本地化无关的方法。
Windows的x86-64 和IA-64 版本有两个用于应用程序文件的文件夹:Program Files 文件夹作为64位程序的默认安装目标,而Program Files (x86) 文件夹是需要WoW64 仿真层的32位程序的默认安装目标。虽然64位Windows版本也具有%ProgramFiles(x86)%
环境变量,但32位和64位环境中的dirids和CSIDL没有区别;API仅返回不同的结果,具体取决于调用进程是否被模拟。 [ 1]
为了向后兼容旧文件分配表 文件名的8.3限制 ,系统将名称“Program Files ”、“Program Files (x86)”和“Common Program Files”缩短为progra~N
和common~N
,其中N 是一个数字,在全新安装中该序列号为 1(当同时存在 “Program Files”和“Program Files (x86)”时,该序列号为 1 和 2)。
重定向
如果Windows安装在NTFS 卷上,默认情况下,“Program Files”文件夹只能由“管理员”用户组的成员修改。对于为Windows 9x 创建的程序来说,这可能是一个问题。这些操作系统没有文件系统安全性,因此程序也可以将其数据存储在“程序文件”中。将数据存储在“Program Files”中的程序通常无法在具有普通用户权限的Windows NT 系统上正确运行,除非降低受影响子目录的安全性。
Windows Vista 通过引入文件和注册表虚拟化 解决了这个问题。当为某个进程启用此 UAC 虚拟化时,Windows 会将对“Program Files”文件夹的更改保存到%LocalAppData%\VirtualStore\Program Files (x86)
中。
历史
“Program Files”出现在Windows 95中。 “Common Files”出现在 Windows 98中。
某个未知版本的Windows NT 使用“Common”而不是“Common Files”。 [ 2] Windows 2000似乎没有表现出这种行为。 CSIDL文档提到“CSIDL_PROGRAM_FILES_COMMON”需要Shell32版本5.0(Windows 2000和ME),但表示它仅在Windows XP(6.0)上有效。 [ 3]
本地化
Windows语言
存储程序文件的 文件夹名称
存储共享程序文件的 文件夹名称
英语
Program Files
Common Files
阿拉伯语
Program Files (ملفات البرامج (x86) for WoW64)
Common Files
中文(简体, 繁体, 台湾)
Program Files
Common Files
捷克语
Program Files
Common Files
丹麦语
Programmer
Fælles filer
荷兰语
Program Files
Common Files
芬兰语
Program Files
Common Files
法语
Programmes *
Fichiers communs
德语
Programme
Gemeinsame Dateien
希伯来语
Program Files
Common Files
Hellenic (Greek)
Αρχεία Εφαρμογών
Common Files
Hungarian
Programfájlok
Common Files
意大利语
Programmi
File comuni
日语
Program Files
Common Files
韩语
Program Files
Common Files
Norwegian
Programfiler
Fellesfiler
Polish
Program Files (Pliki programów (x86) for WoW64)
Common Files
葡萄牙语
Programas
Ficheiros comuns
葡萄牙语 (巴西)
Arquivos de Programas
Arquivos comuns
Romanian
Program Files
Common Files
俄语
Program Files
Common Files
西班牙语
Archivos de programa
Archivos comunes
Swedish
Program
Delade filer
Turkish
Program Files (Program Dosyaları (x86) for WoW64)
Common Files
*在Windows Vista 及更高版本中。(在旧版本的 Microsoft Windows 中,文件夹名称与英文名称相同。)
参见
参考资料
^ winapi - SHGetFolderPath() 32 bit vs 64 bit . Stack Overflow (英语) .
^ Special Folders and Custom Folders . learn.microsoft.com. November 2012 (美国英语) .
^ CSIDL (Shlobj.h) - Win32 apps . learn.microsoft.com. 22 March 2021 (美国英语) . CSIDL_PROGRAM_FILES_COMMON FOLDERID_ProgramFilesCommon Version 5.0. A folder for components that are shared across applications. A typical path is C:\Program Files\Common. Valid only for Windows XP.
延伸阅读
Karp, David A.; O'Reilly, Tim; Mott, Troy. Windows XP in a nutshell 2nd. O'Reilly Media. 2005: 512. ISBN 978-0-5960-0900-7 .
Shilmover, Barry; Sjouwerman, Stu. Windows 2000 power toolkit 1st. Que Publishing. 2001. ISBN 978-0-7357-1061-0 .
外部链接