Ask the Expert

What does "%" mean in a term like %Homepath%?

What does the percent mean in something like %Homepath% or %Homedrive%? And are the words in the middle case sensitive?

    Requires Free Membership to View

The percent signs indicate that they are environment variables that are to be expanded. You can see these in action by starting up a Command Prompt (CMD.EXE). Type the SET command and you'll see all the currently defined environment variables for your account.

On the machine I am using right now, HOMEDRIVE and HOMEPATH are the following according to the SET command:
 

HOMEDRIVE=E:
HOMEPATH=Documents and Settingsjohn

To show it using the expanded environment variables, enter the following command in the Command Prompt window:
 

dir "%homedrive%%homepath%"

This is the equivalent of typing on my machine:
 

dir "e:Documents and Settingsjohn"


 

This was first published in December 2002

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: