Skip to Main Content
Article navigation

The use of environment variables may seem like an esoteric (even incomprehensible) art to the “average user,” but even if you're not Dr. DOS, you might benefit from a little knowledge on the subject. Two environment variables you're probably already familiar with are PATH and PROMPT. These are special variables that are set with their own DOS commands (PATH and PROMPT, respectively) rather than the usual SET command, but they are environment variables nonetheless. You can use environment variables, including PATH and PROMPT, in batch files by simply enclosing the name of the variable in percent signs (e g , %PATH%). For example, you could create a file called STATUS.BAT containing the following lines:

This content is only available via PDF.
You do not currently have access to this content.
Don't already have an account? Register

Purchased this content as a guest? Enter your email address to restore access.

Please enter valid email address.
Email address must be 94 characters or fewer.
Pay-Per-View Access
$39.00
Rental

or Create an Account

Close Modal
Close Modal