Windows平台上的环境变量

Windows XP中比较常见的预定义环境变量

===========================

Variable

Typical value (May vary, depending on system)

%ALLUSERSPROFILE%

C:\Documents and Settings\All Users

%APPDATA%

C:\Documents and Settings\{username}\Application Data

%COMPUTERNAME%

{computername}

%COMSPEC%

C:\Windows\System32\cmd.exe

%HOMEDRIVE%

C:

%HOMEPATH%

\Documents and Settings\{username}

%PATH%

C:\Windows\System32\;C:\Windows\;C:\Windows\System32\Wbem

%PATHEXT%

.COM; .EXE; .BAT; .CMD; .VBS; .VBE; .JS ; .WSF; .WSH

%PROGRAMFILES%

Directory containing program files, usually C:\Program Files

%PROMPT%

Code for current command prompt format. Code is usually $P$G

%SYSTEMDRIVE%

The drive containing the Windows XP root directory, usually C:

%SYSTEMROOT%

The Windows XP root directory, usually C:\Windows

%TEMP% and %TMP%

C:\DOCUME~1\{username}\LOCALS~1\Temp

%USERNAME%

{username}

%USERPROFILE%

C:\Documents and Settings\{username}

%WINDIR%

C:\Windows

 

一些动态的环境变量

===========================

Variable

Value

%DATE%

Current date in the format determined by the Date command

%TIME%

Current time in the format determined by the Time command

%CD%

Current directory with its full path

%ERRORLEVEL%

Number defining exit status of a previous command or program

%RANDOM%

Random number between 0 and 32767

 

Windows Vista/ 7 中常见的预定义环境变量

============================

Variable

Typical value (May vary, depending on system)

%ALLUSERSPROFILE%

C:\ProgramData

%APPDATA%

C:\Users\(username}\AppData\Roaming

%CommonProgramFiles%

C:\Program Files\Common Files

%COMPUTERNAME%

{computername}

%COMSPEC%

C:\Windows\System32\cmd.exe

%HOMEDRIVE%

C:

%HOMEPATH%

\Users\{username}

%LOCALAPPDATA%

C:\Users\{username}\AppData\Local

%PATH%

Varies. Includes C:\Windows\System32\;C:\Windows\;C:\Windows\System32\Wbem

%PATHEXT%

.COM; .EXE; .BAT; .CMD; .VBS; .VBE; .JS ; .WSF; .WSH; .MSC

%ProgramData%

C:\ProgramData

%PROGRAMFILES%

Directory containing program files, usually C:\Program Files

%ProgramFiles(x86)%

In 64-bit systems, directory containing 32-bit programs. Usually C:\Program Files (x86)

%PROMPT%

Code for current command prompt format. Code is usually $P$G

%Public%

C:\Users\Public

%SYSTEMDRIVE%

The drive containing the Windows XP root directory, usually C:

%SYSTEMROOT%

The Windows XP root directory, usually C:\Windows

%TEMP% and %TMP%

C:\Users\{Username}\AppData\Local\Temp

%USERNAME%

{username}

%USERPROFILE%

C:\Users\{username}

%WINDIR%

C:\Windows

 

资料来源:

Environment Variables in Windows XP

http://vlaurie.com/computers2/Articles/environment.htm

Environment Variables in Windows Vista and Windows 7

http://vlaurie.com/computers2/Articles/environment-variables-windows-vista-7.htm

posted on   中道学友  阅读(783)  评论(0编辑  收藏  举报

编辑推荐:
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律

导航

< 2010年3月 >
28 1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31 1 2 3
4 5 6 7 8 9 10

技术追求准确,态度积极向上

点击右上角即可分享
微信分享提示