Re: Whats the %=C:% environment variable used for ?
"R.Wieser" <[email protected]> Fri, 6 Feb 2026 20:32:27 +0100
| Newsgroups | alt.comp.os.windows-xp,alt.windows7.general,alt.comp.os.windows-10,alt.msdos.batch.nt |
|---|---|
| Organization | A noiseless patient Spider |
| Message-ID | <[email protected]> |
Herbert,
> some more information about "Undocumented Dynamic variables":
>
> https://ss64.com/nt/syntax-variables.html
Funny: They start with mentioning the allowed characters for the variable
name, and a bit later on showing that that gets violated.
And by the way, as I've mentioned a few times, the "=" *can* be part of the
variable name (as its first character) just not when trying to write.(to)
one ("echo %=C:%" does work)
> and especially for the %=C:% :
>
> https://devblogs.microsoft.com/oldnewthing/20100506-00/?p=14133
[quote]
But why put these internal variables in the environment? Can't they just be
regular variables inside the cmd.exe process?
The variables are exported into the environment because you want these "fake
per-drive current directories" *to be inherited by child processes*.
[/quote]
(bolding mine)
Yep, at some point I realized that that might be the /only/ reason for them
to be there.
[quote]
What should you do about these variables, then?
Nothing. Just let them be and do their jobs. Im just mentioning them here
so you wont freak out when you see them.
[/quote]
Meh. :-)
Thanks for the info.
Regards,
Rudy Wieser