Windows 10 上的环境变量的完整列表
使用这些环境变量快速浏览任何计算机上的 Windows 10 位置。
Windows 10 上,环境变量是预定义的名称,表示操作系统中某些位置的路径,例如驱动器或特定文件或文件夹。
环境变量在许多情况下都有用,但如果您是 IT 人员或正在修理其他人的计算机,它们尤其有用,因为您可以快速导航到某些位置,甚至不知道用户名或完整路径一个系统文件夹。
例如C:Users
在本指南中,您将了解可在Windows 10上使用的最常见环境变量的列表。
| Variable | Windows 10 |
|---|---|
| %ALLUSERSPROFILE% | C:ProgramData |
| %APPDATA% | C:Users{username}AppDataRoaming |
| %COMMONPROGRAMFILES% | C:Program FilesCommon Files |
| %COMMONPROGRAMFILES(x86)% | C:Program Files (x86)Common Files |
| %CommonProgramW6432% | C:Program FilesCommon Files |
| %COMSPEC% | C:WindowsSystem32cmd.exe |
| %HOMEDRIVE% | C: |
| %HOMEPATH% | C:Users{username} |
| %LOCALAPPDATA% | C:Users{username}AppDataLocal |
| %LOGONSERVER% | {domain_logon_server} |
| %PATH% | C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem |
| %PathExt% | .com;.exe;.bat;.cmd;.vbs;.vbe;.js;.jse;.wsf;.wsh;.msc |
| %PROGRAMDATA% | C:ProgramData |
| %PROGRAMFILES% | C:Program Files |
| %ProgramW6432% | C:Program Files |
| %PROGRAMFILES(X86)% | C:Program Files (x86) |
| %PROMPT% | $P$G |
| %SystemDrive% | C: |
| %SystemRoot% | C:Windows |
| %TEMP% | C:Users{username}AppDataLocalTemp |
| %TMP% | C:Users{username}AppDataLocalTemp |
| %USERDOMAIN% | Userdomain associated with current user. |
| %USERDOMAIN_ROAMINGPROFILE% | Userdomain associated with roaming profile. |
| %USERNAME% | {username} |
| %USERPROFILE% | C:Users{username} |
| %WINDIR% | C:Windows |
| %PUBLIC% | C:UsersPublic |
| %PSModulePath% | %SystemRoot%system32WindowsPowerShellv1.0Modules |
| %OneDrive% | C:Users{username}OneDrive |
| %DriverData% | C:WindowsSystem32DriversDriverData |
| %CD% | Outputs current directory path. (Command Prompt.) |
| %CMDCMDLINE% | Outputs command line used to launch current Command Prompt session. (Command Prompt.) |
| %CMDEXTVERSION% | Outputs the number of current command processor extensions. (Command Prompt.) |
| %COMPUTERNAME% | Outputs the system name. |
| %DATE% | Outputs current date. (Command Prompt.) |
| %TIME% | Outputs time. (Command Prompt.) |
| %ERRORLEVEL% | Outputs the number of defining exit status of previous command. (Command Prompt.) |
| %PROCESSOR_IDENTIFIER% | Outputs processor identifier. |
| %PROCESSOR_LEVEL% | Outputs processor level. |
| %PROCESSOR_REVISION% | Outputs processor revision. |
| %NUMBER_OF_PROCESSORS% | Outputs the number of physical and virtual cores. |
| %RANDOM% | Outputs random number from 0 through 32767. |
| %OS% | Windows_NT |
虽然您可以使用环境变量来快速访问其中的某些位置windows 10,您通常会在构建脚本或应用程序时使用这些变量。
请记住,提到的一些变量不是特定于位置的,包括%COMPUTERNAME%, %PATHEXT%, %PROMPT%, %USERDOMAIN%, %USERNAME%。
相关文章
U盘装系统(http://www.upzxt.net) 版权所有 (网站邮箱:78435178@qq.com)
本站资源均收集与互联网,其著作权归原作者所有,如侵犯到您的权益的资源,请来信告知,我们及时撤销相应资源