Variables used in XP

  • Thread starter Thread starter David Peters
  • Start date Start date
D

David Peters

Is there a list of variables used in XP?

Google can't find the % sign.

There is, of course, %1 which I call the first parameter passed when
calling a program (even in the registry).

I believe there is %l (= "this folder" ???) and %r and no doubt many
others. But I can't locate the info about them.
 
David Peters said:
Is there a list of variables used in XP?

Google can't find the % sign.

There is, of course, %1 which I call the first parameter passed when
calling a program (even in the registry).

I believe there is %l (= "this folder" ???) and %r and no doubt many
others. But I can't locate the info about them.

Start a Command Prompt (Start / Run / cmd.exe {OK}),
then type this command:

set {Enter}

You will now see every environmental variable that's defined
on your machine. Different machines have different variables,
depending on what software you have installed.

On top of that there are some variables that change as you go.
Type these commands to see some of them:

echo %date%
echo %time%
echo %cd%
 
David said:
Is there a list of variables used in XP?

Google can't find the % sign.

There is, of course, %1 which I call the first parameter passed when
calling a program (even in the registry).

I believe there is %l (= "this folder" ???) and %r and no doubt many
others. But I can't locate the info about them.

Environment Variables?

CMD Prompt and enter:

SET

and anything there (if proceded and followed by the percent sign) can be
used in a CMD/BAT script.

For example..

--- copy below here ---
@ECHO OFF
ECHO %time% and %date%
ECHO.
ECHO %username%'s profile is located at %userprofile%.
ECHO You are running this from %cd%.
ECHO If you asked for a somewhat random number,
ECHO I would give you %random%.
ECHO.
ECHO You can run these anywhere:
ECHO %PATHEXT%
ECHO.
ECHO And anything found in your path statement is easily accessed as well:
ECHO %PATH%
ECHO.
ECHO Do not forget any of these:
SET
--- copy above here ---

Decent web pages..

http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds.mspx
http://vlaurie.com/computers2/Articles/environment.htm
 
Paste the following line into Start | Run and click OK...

hh ntcmds.chm::/ntcmds_shelloverview.htm

Scroll down about half way and look at the table.

Or hit Ctrl + F and paste this in the Find what box..

The following table lists the system and local environment variables for
Windows XP.

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
 
For Explorer,

%1 - Long file name for 32 bit programs and LFN aware 16 bit programs. Short file name for all other cases incl where explorer can't find the exe (because a path isn't specified - explorer may not be able to find a file as it won't search for it but that doesn't mean CreateProcess won't find it).

%L Long file name

%I IDList, internal to explorer.

Note %1 for explorer and %1 for cmd and different things.
 
%S is the window style and %H is the hotkey. Both of these are used when changing folders.

--
--------------------------------------------------------------------------------------------------
Goodbye Web Diary
http://margokingston.typepad.com/harry_version_2/2005/12/thank_you_and_g.html#comments
=================================================
"David Candy" <.> wrote in message For Explorer,

%1 - Long file name for 32 bit programs and LFN aware 16 bit programs. Short file name for all other cases incl where explorer can't find the exe (because a path isn't specified - explorer may not be able to find a file as it won't search for it but that doesn't mean CreateProcess won't find it).

%L Long file name

%I IDList, internal to explorer.

Note %1 for explorer and %1 for cmd and different things.
 
Back
Top