Understanding Windows XP's environment variables
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:
- Open a Command Prompt window.
- 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!
Print/View all Posts Comments on this article
SponsoredWhite Papers, Webcasts, and Downloads
- Nextel Direct Connect Fact Sheet Sprint
- IBM Master Data Management: Effective Data Governance IBM
- SprintSecure Message Protection Fact Sheet Sprint
- Case Study: GHS Data Management - Improving Data Protection and Storage Reliability for Critical Databases Dell EqualLogic
- Microsoft SQL Server and Dell EqualLogic PS Series Solution Brief Dell EqualLogic
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

