On CNET: First dSLR with video capture

Understanding Windows XP's environment variables

Tags: Operating systems, Greg Shultz, Microsoft Windows, processor, Microsoft Windows XP, environment variable, home directory, operating system, Windows XP Tips Newsletter

  • Save
  • Print
  • Digg This
  • 1

Takeaway: Windows XP's environment variables control the behavior of batch files and programs, and also control the way Windows XP and the MS-DOS subsystem appears and works. Check out this list of environment variables, along with their descriptions.

Environment variables are used to control the behavior of batch files and programs in Windows XP; they also control the way Windows XP and the MS-DOS subsystem appears and works. To see a complete list of the environment variables that are active on a Windows XP system, follow these steps:

  1. Open a Command Prompt window.
  2. Type Set and press [Enter].

You'll see a list of the current environment variable settings. While some of them are familiar, such as PATH, and some are easy to figure out, such as COMPUTERNAME, others are more cryptic. Here's a sampling of Windows XP's environment variables:

    • ALLUSERSPROFILE: Lists the location of the All Users Profile.
    • APPDATA: Lists the location where applications store data by default.
    • CD: Lists the current directory string.
    • CLIENTNAME: List the client's NETBIOS name when connected to terminal server session.
    • CMDCMDLINE: Lists the command line used to start the current cmd.exe.
    • CMDEXTVERSION: Lists the version number of the current Command Processor Extensions.
    • CommonProgramFiles: Lists the path to the Common Files folder.
    • COMPUTERNAME: Lists the name of the computer.
    • COMSPEC: Lists the path to the command shell executable.
    • DATE: Lists the current date.
    • ERRORLEVEL: Lists the error code of the most recently used command.
    • HOMEDRIVE: Lists the drive letter is connected to the user's home directory.
    • HOMEPATH: Lists the full path of the user's home directory.
    • HOMESHARE: Lists the network path to the user's shared home directory.
    • LOGONSEVER: Lists the name of the domain controller that validated the current logon session.
    • NUMBER_OF_PROCESSORS: Lists the number of processors installed on the computer.
    • OS: Lists the name of the operating system. (Windows XP and Windows 2000 list the operating system as Windows_NT.)
    • Path: Lists the search path for executable files.
    • PATHEXT: Lists the file extensions that the operating system considers to be executable.
    • PROCESSOR_ARCHITECTURE: Lists the processor's chip architecture.
    • PROCESSOR_IDENTFIER: Lists the description of the processor.
    • PROCESSOR_LEVEL: Lists the model number of the computer's processor.
    • PROCESSOR_REVISION: Lists the revision number of the processor.
    • ProgramFiles: Lists the path to the Program Files folder.
    • PROMPT: Lists the command-prompt settings for the current interpreter.
    • RANDOM: Lists a random decimal number between 0 and 32767.
    • SESSIONNAME: Lists the connection and session names when connected to terminal server session.
    • SYSTEMDRIVE: Lists the drive containing the Windows root directory.
    • SYSTEMROOT: Lists the location of the Windows root directory.
    • TEMP and TMP: List default temporary directories for applications that are available to users who are currently logged on.
    • TIME: Lists the current time.
    • USERDOMAIN: Lists the name of the domain that contains the user's account.
    • USERNAME: Lists the name of the user currently logged on.
    • USERPROFILE: Lists the location of the profile for the current user.
    • WINDIR: Lists the location of the OS directory.

Miss a tip?

Check out the Windows XP archive, and catch up on our most recent Windows XP tips.

Stay on top of the latest XP tips and tricks with our free Windows XP newsletter, delivered each Thursday. Automatically sign up today!

  • Save
  • Print
  • Digg This
  • 1

Print/View all Posts Comments on this article

USERNAME changes caseStephenInScotland  | 12/08/05
username casejefferson.harris@...  | 12/08/05
username caseStephenInScotland  | 12/09/05
DOS ? not hardlyRick Hults  | 12/18/05
DOS ? not hardlyRick Hults  | 12/18/05
Run them up side-by-sideneilb@...  | 12/18/05
Complete listJudith.Foeglein@...  | 12/08/05
Microsoft list of VariablesWillicueva  | 12/08/05
XP Home Editionhoward17709@...  | 12/08/05
You misunderstandmjhammer  | 12/08/05
Command formatNickNielsen  | 12/08/05
"SET" in XP Home Editiondlrcomputerrepairs@...  | 12/19/05
"SET" in XP Home Editiondlrcomputerrepairs@...  | 12/19/05
Don't forget most of us are Techies who ..ArthurP  | 01/05/06
ok, so what.lmiyaoka@...  | 12/12/05
My thoughts exactlyM_a_r_k  | 12/13/05
that's the problem with ITdrobert  | 12/22/05
Amen to that!Willicueva  | 12/22/05
So Trueinnocent_bystander  | 01/17/06
'knowledge puffeth up and leadeth to vanity.'paul@...  | 01/20/06
one more thingpaul@...  | 01/20/06
so what?averase@...  | 01/03/06
PATH variableTimothy J. Bruce  | 04/03/06
Using these variables from within an Office or Email programdeepwoods@...  | 05/23/07

What do you think?

Article Categories

Security
Security Solutions, IT Locksmith
Networking and Communications
E-mail Administration NetNote, Cisco Routers and Switches
CIO and IT Management
Project Management, CIO Issues, Strategies that Scale
Desktops, Laptops & OS
Windows 2000 Professional, Microsoft Word, Microsoft Excel, Microsoft Access, Windows XP,
Data Management
Oracle, SQL Server
Servers
Windows NT, Linux NetNote, Windows Server 2003
Career Development
Geek Trivia
Software/Web Development
Web Development Zone, Visual Basic, .NET
advertisement
Click Here