Windows environment variables

by admin on October 16, 2011

Windows has the below list of environment variables.

ALLUSERSPROFILE
APPDATA
CommonProgramFiles
CommonProgramFiles(x86)
CommonProgramW6432
COMPUTERNAME
ComSpec
DEFLOGDIR
FP_NO_HOST_CHECK
HOMEDRIVE
HOMEPATH
LOCALAPPDATA
LOGONSERVER
NUMBER_OF_PROCESSORS
OS
Path
PATHEXT
PROCESSOR_ARCHITECTURE
PROCESSOR_IDENTIFIER
PROCESSOR_LEVEL
PROCESSOR_REVISION
ProgramData
ProgramFiles
ProgramFiles(x86)
ProgramW6432
PROMPT
PSModulePath
PUBLIC
SESSIONNAME
SystemDrive
SystemRoot
TEMP
USERDNSDOMAIN
USERDOMAIN
USERNAME
userpath
USERPROFILE
VSEDEFLOGDIR
windir

The list may vary slightly on your computer depending on the OS edition and the list of applications you installed on your computer.

In addition to the above, there are few more environment variables which are not displayed by ‘set’ command. But these can be used in windows command line or in batch files. They are listed below.

%CD%  : can be used to get the current directory
%DATE%    : can be used to get the date
%TIME%   : can be used to get the time
%RANDOM%  : can be used to get random number between 0 and 32767
%ERRORLEVEL%  : can be used to get the error level value
%CMDEXTVERSION% : gets current Command Processor Extensions
%CMDCMDLINE% : gets the command line executable that invoked the command prompt.
%HIGHESTNUMANODENUMBER%  : Gets the highest numa node number on this computer

How to modify environment variables values?
We can use ‘Set’ command to change environment variables from command line.

{ 1 comment… read it below or add one }

Firefox264 October 17, 2011 at 8:38 am

Thank you :)

Reply

Leave a Comment

Previous post:

Next post: