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

    From R.Wieser@address@is.invalid to alt.comp.os.windows-xp,alt.windows7.general,alt.comp.os.windows-10,alt.msdos.batch.nt on Sat Feb 7 07:31:29 2026
    From Newsgroup: alt.windows7.general

    Herbert,

    You can post the screen shot in: de.alt.dateien.misc
    and in the text-only group just give the information
    that you posted it there.

    I was thinking of aioe.test as a possibility, but wondered (doubted) if that one would propagate to all the other news servers.

    Thanks for the info, I've stored it for future usage.

    Regards,
    Rudy Wieser


    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From R.Wieser@address@is.invalid to alt.comp.os.windows-xp,alt.windows7.general,alt.comp.os.windows-10 on Sat Feb 7 08:30:01 2026
    From Newsgroup: alt.windows7.general

    Arlen,

    Windows contains secrets normally kept hidden under the floorboards.

    Ohhh, omnious.

    Following on what Frank said, it turns out Windows creates "drive-specific current directory" environment variables which look funnily like this.
    =C:
    ...
    Each one stores the current working directory (cwd) for that drive.

    You didn't need Frank for that, its what I mentioned in my initial post.

    Try this:
    C:\> cd \Windows
    C:\Windows> D:
    D:\> cd \Games
    D:\Games> C:
    C:\Windows>
    Notice how switching back to C: returns you to C:\Windows automatically? That's because Windows stored it in that =X: stuff.

    What if I tell you that the contents of those =X: environment variables are only updated from where the data is stored internally. Could you prove me wrong ? Can you prove that you are right ?

    If (when) you can't prove either than your above statement is nothing more than an idea that you, as so often, present as if its a fact.

    They're maintained internally by the OS,

    No, they are not.

    not by the shell

    "the shell" ? Whats that ? I know a few programs I could refer to as shells.

    so you can't read them (echo %=C:%) or see them with set or even write to them.

    Funny that, you claim you can't read / see them using the command
    interpreters "set" command ...

    Try these proof-of-concept examples:
    C:\> cd \Windows
    C:\Windows> echo %=C:%
    C:\Windows

    Switch drives:
    C:\Windows> D:
    D:\> echo %=C:%
    C:\Windows
    It stays the same until you change directories on C:.

    ... and here, directly below it, you are telling me that you *can* read /
    see them.

    So, which one is it ?

    Bottom line :
    I don't believe that those environment variables are *used* to remember the different drives current paths. Nowerdays the actual, used paths are most likely stored internally, and the environment variables contents are updated from them.

    However, one believable reason to have them available as environment
    variables has been mentioned by someone.

    Regards,
    Rudy Wieser


    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From R.Wieser@address@is.invalid to alt.comp.os.windows-xp,alt.windows7.general,alt.comp.os.windows-10 on Sat Feb 7 11:13:13 2026
    From Newsgroup: alt.windows7.general

    Frank,

    Current working directory, to be precise.

    Nope, thats something else.

    No, it is,

    Yes, it is. Prove me wrong, why don't you.

    Thats the whole problem with people like you. You guys claim wrongdoing,
    but for "some reason" (yeah, right) "forget" to provide substanciation for such a claim.

    .. I wonder why ... <whistle>

    but - as usual - you snipped the/your context.

    And as always you complain about me/others do not quote to your liking but
    *as always* "forget" to mention how they *should* have done it.

    Ofcourse, if you /would/ do that than there is a big chance that me/those others would point out that most of what you want to see quoted has zero to
    do with the provided reply.

    You think otherwise ? Than put your money where your mouth is and prove it.

    Also, in the past you've shown yourself to be quite hypocritical about such quoting, snipping stuff that was actually part of what re reply was about.

    Bottom line,
    your "you're (quoteing) wrong!" <full stop> claims have long ago ceased to impress me.

    "The %=C:% environment variable in Windows is a hidden, special
    system-wide variable that stores the current working directory
    for the C: drive.

    See? "current working directory", like I said.

    What I see is that you "forgot" to read the whole line, especially the part after "current working directory". Whats that about again about others snipping important information ? You're the pot who claims that the kettle is black.

    FYI: Windows processes have a "current working directory" that has *nothing* to do with the ones for each drive.

    Worse : programs do not even have a possibility to do a "cd". Thats all the command processors doing.

    Its certainly not system-wide.

    It probably was in the "legacy mechanism". Another part you
    snipped.

    See a pattern there!? :-(

    Yeah, I do. You have very little actual knowledge about how Windows works
    and even when someone hits you with a clue bat you will refuse to check it
    out for yourself.

    Here are the key details about %=C:%:
    [snip]

    That explains nothing about its usage.

    It's usage is rather obvious from the snipped (Sigh!) example.

    :-) Kiddo, I said *USAGE*, not how the command-processor changes it when
    you do something like a CD. Learn to read. *Deep sigh*

    The others had no problems understanding it's usage, See for
    example, but not only, Kenny's response.

    Most all of the others skirted the question. Just like you. Only one person provided something thats plausible, and it wasn't Kenny.

    The question still stands : What is the "=C:" environment variable used
    for ?

    Sigh!

    To know the current working directory on the C: drive, when the
    active working directory is on another drive.

    Idiot. You must have never heard of relative paths.

    And no, a programmer being of sound mind would *not* use that environment variable for it. There are better ways to get a drives "current working directory".

    As it's an environment variable, it can be used in other commands,
    etc..

    And there we are, arriving at the question (in the caption and the first
    post) : Whats the %=C:% environment variable used for ?

    In all my years I've never seen it used (in batch files or otherwise). Probably because command processors also recognise and can work with
    relative paths.

    Regards,
    Rudy Wieser


    --- Synchronet 3.21d-Linux NewsLink 1.2