Re: Whats the %=C:% environment variable used for ?

[email protected] (Kenny McCormack) Fri, 6 Feb 2026 17:50:55 -0000 (UTC)
Newsgroups alt.comp.os.windows-xp,alt.windows7.general,alt.comp.os.windows-10,alt.msdos.batch.nt
Organization The official candy of the new Millennium
Message-ID <[email protected]>
In article <[email protected]>, R.Wieser <[email protected]> wrote:
>Mr. Man-wai Chang,
>
>>>> How about a screenshot??
>>>
>>> Of what ?
>...
>> A screen-shot of the Command Prompt window that showed what you
>>> just said might help.
>
>What about you typing it in your puters console and see for yourself ? 
>Just type "echo %=C:%" and see what the result is.   No screenshot needed.

First, to answer the thread question: My understanding is that this *is*
how processes in DOS/Windows keep track of the current directory for each
drive.  Note that the idea of multiple "current directories" - i.e., the
concept of each drive having its own current directory - is kind of unique
to DOS/Windows.  Unix doesn't have it and, in fact, neither does the real
underlying (NT) OS in modern Windows.  It is something that is emulated in
userland software so that modern Windows works similarly to original DOS.

So, the point is that there are "hidden" environment variables for each
drive that has a current directory other than \.  For example, on the
machine I just tested this on, every drive other than C: had its current
directory at the root, so the only env var I could find was the
"=C:\foo\bar\whatever".

That said, I am genuinely (non-rhetorically) curious as to how you
discovered this in the first place, given that these variables are not
displayed by the DOS "set" command.  You'd have needed to use some other
tool to scan the environment table.  For that reason, a screenshot would
actually have been useful.  Or, you could just tell us how you found it...

Two other notes:

    1) I first became aware of this from a post made (a long time ago) in
    the tech support forum of some other Windows product, by the devs of
    that product, who are people who know what they are talking about.
    That other product (tool) does, indeed, have the ability to access
    these variables.

    2) (Speaking of screenshots) Given that this is Usenet, and Usenet is
    (supposed to be) a text-only medium, how would one go about posting a
    screenshot, should one desire to do so?  Is there any established
    protocol?

-- 
Indeed, most .NET developers couldn't pass CS101 at a third-rate
community college.
		- F. Russell -