Windows environment variables
All operating systems of Windows kind has special variables that store various data.
Usually, it is the system information. You can also create own variables.
The list of variables can be seen in the management panel "System properties", "Advanced", "Environment variables":
You can also open it by using the command set in the console (cmd.exe).
To receive a variable value , you need to use the symbol "%": %USERNAME%. The letter case is not important.
A list of a common variables for MyChat
Variable |
Type |
Description |
ALLUSERSPROFILE |
local |
full path to the profile folder "All Users". Returns the path to the folder C:\ProgramData\ in Windows 7 |
APPDATA |
system |
the folder with application data. In Windows XP C:\Documents and Settings\%UserName%\Application Data. В Windows 7 C:\Users\%UserName%\AppData\Roaming |
CLIENTNAME |
local, dynamic |
exists only in an environment of computer remote connection (remote desktop). Stores the computer name (%COMPUTERNAME%) of the remote client; |
COMMONPROGRAMFILES |
system |
folder location "Common Files" (usually %ProgramFiles%\Common Files); |
COMMONPROGRAMFILES(x86) |
system |
folder location "Common Files" in Program Files (x86) for x64 OS (usually %ProgramFiles (x86)%\Common Files). Not available in x32 OS; |
COMPUTERNAME |
system |
computers name; |
COMSPEC |
system |
path to the executable file of a command processor (shell); |
HOMEDRIVE |
system |
disk name of a local working station; |
HOMEPATH |
system |
full path to the user main folder; |
HOMESHARE |
system |
network path to the user common main folder; |
LOCALAPPDATA |
system |
returns applications local place used by default (C:\Users\%UserName%\AppData\Local); |
LOGONSERVER |
local |
domain controller name used for a user authorization; |
NUMBER_OF_PROCESSORS |
system |
number of processor cores in the system; |
OS |
system |
OS name. Windows XP and Windows 2000 displayed as Windows_NT; |
PATH |
system |
search path of executable files; |
PATHEXT |
system |
list of files extensions that the system considers as executable; |
PROCESSOR_ARCHITECTURE |
system |
microprocessor architecture (x86, IA64, AMD64); |
PROCESSOR_IDENTIFIER |
system |
microprocessor. For example "Intel64"; |
PROCESSOR_LEVEL |
system |
microprocessor model number; |
PROCESSOR_REVISION |
system |
microprocessor version; |
PROGRAMDATA |
system |
folder path C:\ProgramData\ (same as ALLUSERSPROFILE); |
PROGRAMFILES |
system |
path to the folder Program Files; |
PROGRAMFILES(x86) |
system |
path to the folder Program Files (x86) in x64 operating systems for applications with x86 architecture. Unavailable in x32 systems; |
PUBLIC |
system |
in Windows 7 and higher returns the path to the folder C:\Users\Public |
SYSTEMDRIVE |
system |
disk with Windows root directory; |
SYSTEMROOT |
system |
path Windows root directory; |
TEMP и TMP |
system and local |
temporary folders used by applications available for authorized users. Some applications require the variable TEMP, and other TMP. Formally TEMP and TMP may indicate various folders that ussually match; |
USERDOMAIN |
local |
user's domain name; |
USERNAME |
local |
current name of a Windows user; |
USERPROFILE |
local |
path to a current user profile; |
WINDIR |
system |
folder with installed Windows. |