What's meaning of "%" in pathnames?

  • Thread starter Thread starter Terry B.
  • Start date Start date
T

Terry B.

This question is so simple and basic, I can't find an answer...What's
the significance of the percent sign when used in pathnames? Example:
`%SYSTEMROOT%\`, [or] `%USERNAME%\` ???
I realize that my asking this marks me as the ultimate newbie; it's
what it is. Everyone's ignorant at least once ((-;
Thanks for your time and attention to detail.
riprap.
 
Wildcard for the drive
Just in case your System root is not the "C" drive for example
 
Those are environment variables.

eg. %SYSTEMROOT% is typically set to something like:
c:\windows
 
Terry said:
This question is so simple and basic, I can't find an answer...What's
the significance of the percent sign when used in pathnames? Example:
`%SYSTEMROOT%\`, [or] `%USERNAME%\` ???
I realize that my asking this marks me as the ultimate newbie; it's
what it is. Everyone's ignorant at least once ((-;
Thanks for your time and attention to detail.
riprap.

% is the delimiter for environment variable names.

Open a cmd shell ( START > Run... > cmd )
In the cmd shell window type
set
and press the Enter key to get a list of environment variables.

Here are some of the ones you might want to bother to remember.

%UserProfile% (Folder where your START menu, Desktop and My Documents lives.)
%WinDir% (Typically C:\Windows, but could be D:\Windows or E:\Win... )
%ProgramFiles% (Default folder for program installs)
%TEMP% (The temporary file folder in your profile)

Bob
 
Bob Dietz said:
Terry said:
This question is so simple and basic, I can't find an answer...What's
the significance of the percent sign when used in pathnames? Example:
`%SYSTEMROOT%\`, [or] `%USERNAME%\` ???
I realize that my asking this marks me as the ultimate newbie; it's
what it is. Everyone's ignorant at least once ((-;
Thanks for your time and attention to detail.
riprap.

% is the delimiter for environment variable names.

Open a cmd shell ( START > Run... > cmd )
In the cmd shell window type
set
and press the Enter key to get a list of environment variables.

Here are some of the ones you might want to bother to remember.

%UserProfile% (Folder where your START menu, Desktop and My Documents lives.)
%WinDir% (Typically C:\Windows, but could be D:\Windows or E:\Win... )
%ProgramFiles% (Default folder for program installs)
%TEMP% (The temporary file folder in your profile)

Bob

To Bob, Dave & Tech5,
Thanks for the excellent replies! I've got 6 or 7 XP books around
here, several of them use the "%" in examples [esp. when dealing with
tweaking the registry], but none of them bother to explain just what
the symbol means. I had no idea you could bring up a cmd window & type
in "%SYSTEMROOT%", and would be brought to C:\WINDOWS.
I appreciate the help, and have yourselves and excellent day ((-;

riprap.
 
Terry said:
Bob Dietz said:
Terry B. wrote:

This question is so simple and basic, I can't find an answer...What's
the significance of the percent sign when used in pathnames? Example:
`%SYSTEMROOT%\`, [or] `%USERNAME%\` ???
I realize that my asking this marks me as the ultimate newbie; it's
what it is. Everyone's ignorant at least once ((-;
Thanks for your time and attention to detail.
riprap.

% is the delimiter for environment variable names.

Open a cmd shell ( START > Run... > cmd )
In the cmd shell window type
set
and press the Enter key to get a list of environment variables.

Here are some of the ones you might want to bother to remember.

%UserProfile% (Folder where your START menu, Desktop and My Documents lives.)
%WinDir% (Typically C:\Windows, but could be D:\Windows or E:\Win... )
%ProgramFiles% (Default folder for program installs)
%TEMP% (The temporary file folder in your profile)

Bob


To Bob, Dave & Tech5,
Thanks for the excellent replies! I've got 6 or 7 XP books around
here, several of them use the "%" in examples [esp. when dealing with
tweaking the registry], but none of them bother to explain just what
the symbol means. I had no idea you could bring up a cmd window & type
in "%SYSTEMROOT%", and would be brought to C:\WINDOWS.
I appreciate the help, and have yourselves and excellent day ((-;

riprap.

If you have the address bar displayed in Explorer -
View > Toolbars > Address Bar
(I put mine next to the menu bar just right of 'Help'.)
environment variables work there as well.

Bob
 
Terry said:
This question is so simple and basic, I can't find an answer...What's
the significance of the percent sign when used in pathnames? Example:
`%SYSTEMROOT%\`, [or] `%USERNAME%\`

Names in % % are 'Environmental variables', so that the name can be used
in things like commands to represent something that may vary between
machines. The values to use on a particular machine are held in the
registry, and some can be edited by the user - At Control Panel - System
- Advanced.

Thus %Systemroot% usually means C:\Windows because that is usually the
folder where Windows is to be found. But a dual boot machine might well
have D:\Windows instead; and on this machine (for historical reasons -
ie I can't be bothered to change it) it is C:\Win95

%Username% is the name associated with the current logon. If you log on
as Terry it will be set to 'Terry'. And this means that when something
wants say *your* version of favorites, it can look for C:\Documnents and
Settings\%Username%\Favorites and get *your* list
 
I looked in an old DOS manual and could not find a direct answer, so I'll
try to
point you in the right direction.

For starters, and it sounds like you recognize it, is that the single quotes
are called
delimiters. It is my best guess that the % symbol is a second delimiter,
telling the
program reading (or parsing) this line that username is a predefined
variable.
Perhaps an e-mail account or whatever?

The \ symbol is probably the start of another variable supplied by the user
with
with the ? symbol being place holders to represent three characters. Your
question
implies the ??? is a file extension.

Hope this helps a little!
Lurker
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top