what are all the windows system variables?

A

Andy Svendsen

Is there a list or anything? I know of %allusersprofile% (location of all
users folder), %computername%, %systemroot%, %username%, %os%...does anyone
know all of them?

--
*******************************************************************
Andy S.
MCSE NT/2000, MCDBA SQL 7/2000
(e-mail address removed)

Please remove NOMORESPAM before replying.

Always keep your antivirus and Microsoft software
up to date with the latest definitions and product updates.
Be suspicious of every email attachment, I will never send
or post anything other than the text of a http:// link nor
post the link directly to a file for downloading.

This posting is provided "as is" with no warranties
and confers no rights.

*******************************************************************
 
W

Walter Schulz

Why this crosspost?
Is there a list or anything? I know of %allusersprofile% (location of all
users folder), %computername%, %systemroot%, %username%, %os%...does anyone
know all of them?

at <hh>:<mm+2> /inter cmd /k set

By the way: %username% isn't a system but user variable.

Ciao, Walter
 
B

Bill Stewart

Andy Svendsen said:
Is there a list or anything? I know of %allusersprofile% (location of
all users folder), %computername%, %systemroot%, %username%, %os%...does
anyone know all of them?

...

Andy S.
MCSE NT/2000, MCDBA SQL 7/2000

<polite>
Enter the SET command in a command window.
</polite>

<incredulous>
An MCSE and MCDBA that doesn't know how to list environment variables by
typing the SET command?
</incredulous>

Regards,

Bill
 
R

Reinhardt Kern

Bill Stewart said:
<incredulous>
An MCSE and MCDBA that doesn't know how to list environment variables by
typing the SET command?
</incredulous>

MCSE = Minesweeper Certified, Solitaire Expert

(Solving common tasks with batch scripts or VBscript is not part
of MCSE training.)

Reinhardt *SCNR*
 
B

Bill Stewart

Reinhardt Kern said:
MCSE = Minesweeper Certified, Solitaire Expert

Ah. I thought it stood for "Multiple Choice Selection Expert."
(Solving common tasks with batch scripts or VBscript is not part of MCSE
training.)

Training? Or do you mean test-taking? :)

Regards,

Bill
 
A

Andy Svendsen

I like the acronym. I don't want to start a flame war here, but I will
admit my ignorance, there is no excuse for that. Being a MCSE for as long
as I have, I should have known that. I appreciate your answer. But part of
being a good computer tech is knowing when to put aside pride and do what it
takes to solve a problem.

Ask me a SQL 4.2/6.5/7.0/2k question, a VB script question sometime or a
different question. I'll get you an answer.

Cheers,
Andy S.
(e-mail address removed)

(Remove NOMOREPSAM when replying)
 
A

Andy Svendsen

Thanks, I appreciate all the help here, especially for such an obvious
question.

--
*******************************************************************
Andy S.
MCSE NT/2000, MCDBA SQL 7/2000
(e-mail address removed)

Please remove NOMORESPAM before replying.

Always keep your antivirus and Microsoft software
up to date with the latest definitions and product updates.
Be suspicious of every email attachment, I will never send
or post anything other than the text of a http:// link nor
post the link directly to a file for downloading.

*******************************************************************
 
C

Clay Calvert

<polite>
Enter the SET command in a command window.
</polite>

Bill, that isn't all of them. Maybe an MCSE can help you out a little
bit. ; )

%CD% - expands to the current directory string.

%DATE% - expands to current date using same format as DATE command.

%TIME% - expands to current time using same format as TIME command.

%RANDOM% - expands to a random decimal number between 0 and 32767.

%ERRORLEVEL% - expands to the current ERRORLEVEL value

%CMDEXTVERSION% - expands to the current Command Processor Extensions
version number.

%CMDCMDLINE% - expands to the original command line that invoked the
Command Processor.

Not all listed above are system variables but some are. The link
Ritchie posted was the best source of information for this question.
But one can do "Set /?" as well as "Set" from the prompt to get most,
and often all, of these variables.
<incredulous>
An MCSE and MCDBA that doesn't know how to list environment variables by
typing the SET command?
</incredulous>

It is unfortunate that MS doesn't, or at least hasn't, tested
command-line knowledge. If it was up to me, two-thirds of the server
test would be on scripts and CMD prompt tools that come with the OS
and the ResKit. Nothing third-party.


Clay Calvert
(e-mail address removed)
Replace "W" with "L"
 
M

Matthias Tacke

Clay said:
Bill, that isn't all of them. Maybe an MCSE can help you out a little
bit. ; )

And that spells this time: more competent scripting expertise ? ;-)
 
A

Al Dunbar [MS-MVP]

Reinhardt Kern said:
MCSE = Minesweeper Certified, Solitaire Expert

(Solving common tasks with batch scripts or VBscript is not part
of MCSE training.)

Yeah, seems to me the writers of the standard MS courses were more
interested in the flashy GUI interfaces than in the real workhorses.

/Al
 
A

Al Dunbar [MS-MVP]

Andy Svendsen said:
I like the acronym. I don't want to start a flame war here, but I will
admit my ignorance, there is no excuse for that. Being a MCSE for as long
as I have, I should have known that. I appreciate your answer. But part of
being a good computer tech is knowing when to put aside pride and do what it
takes to solve a problem.


Good answer, and LOL to boot. But don't tell me you picked up your
reasonable approach to problemsolving and your greater concern for learning
than seeming to look smart from a Microsoft course?
Ask me a SQL 4.2/6.5/7.0/2k question, a VB script question sometime or a
different question. I'll get you an answer.

Of that I have no doubt.

/Al
 
B

Bill Stewart

Clay Calvert said:
Bill, that isn't all of them. Maybe an MCSE can help you out a little
bit. ; )

%CD% - expands to the current directory string.

%DATE% - expands to current date using same format as DATE command.

%TIME% - expands to current time using same format as TIME command.

%RANDOM% - expands to a random decimal number between 0 and 32767.

%ERRORLEVEL% - expands to the current ERRORLEVEL value

%CMDEXTVERSION% - expands to the current Command Processor Extensions
version number.

%CMDCMDLINE% - expands to the original command line that invoked the
Command Processor.

Hi Clay,

In my own defense, I might just point out that those are really cmd.exe
"pseudo variables"...

As a simple example, suppose you run this VBScript:

Set objWshShell = CreateObject("Wscript.Shell")
Wscript.Echo objWshShell.Environment("PROCESS")("DATE")

The Echo method will print a blank line.

But yes, you're right, the SET command doesn't list the pseudo-variables.

Regards,

Bill
 
B

Bill Stewart

Clay Calvert said:
The proper term is "dynamic variables".

OK. I just called them "pseudo variables" because they're, well, not really
environment variables, but cmd.exe expands them. I'll try to use the right
term from now on. :)

Regards,

Bill
 

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

Top