Using Environment Variables

Command-prompt operating systems traditionally use environment variables as a means for programs to share information and read global settings. (Windows Vista—and applications written for Windows Vista—use the registry for the same purpose.) To use an environment variable in a command, program, or address, enclose it between percent signs, like this example: %UserName%.

Viewing Environment Variables

The Set command allows you to examine as well as set environment variables. To examine the current environment variables, open a Command Prompt window and type set (without any arguments). Windows Vista displays a list of all the current environment variables and their values, as the following example shows:

ALLUSERSPROFILE=F:\ProgramData ...

Get Windows Vista™ Inside Out now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.