2

When I run the set command in command prompt the first variable I see is

enter image description here

But when I open my Environment Variables GUI I don't see ALLUSERSPROFILE

enter image description here

enter image description here

Why is that? There are numerous other variables listed in set that don't show up in the GUI as well. Shouldn't they all show the same info?

1
  • It is not uncommon on many operating systems to only include common config option in the GUI for standard users and expect that advanced users who would more likely need the less standard options will prefer the command line for their work.
    – MaQleod
    Commented May 9, 2015 at 18:41

2 Answers 2

3

After a bit of trial and error, I discovered that these environment variables are the additional ones reported by SET on my Windows 8.1 system:

ALLUSERSPROFILE
APPDATA
COMPUTERNAME
CommonProgramFiles
CommonProgramFiles(x86)
CommonProgramW6432
HOMEDRIVE
HOMEPATH
LOCALAPPDATA
LOGONSERVER
PROMPT
PUBLIC
ProgramData
ProgramFiles
ProgramFiles(x86)
ProgramW6432
SESSIONNAME
SystemDrive
SystemRoot
USERDOMAIN
USERDOMAIN_ROAMINGPROFILE

I suspect that they are all automatically generated and updated by Windows, which is probably why I couldn't find some of them listed anywhere in Windows Registry.

I know that HOMEDRIVE, HOMEPATH and HOMESHARE are updated automatically from this TechNet Forums post.

I tried permanently changing the PROMPT variable to something other than $P$G (which is the default) using SETX and noticed that it created a new PROMPT environment variable in the User variables for <username> section in the Environment Variables GUI.

On deleting that variable, my prompt was reset back to $P$G. I noticed the same behavior with COMPUTERNAME environment variable. The same goes for:

CommonProgramFiles
CommonProgramW6432
PROCESSOR_ARCHITECTURE
ProgramFiles
ProgramW6432

as explained in this MSDN article about WOW64 Implementation Details.

1

According to SS64.com (Autoexec.bat section), those variables may be boot-time variables, that are "not available to 32 bit gui programs". Since Windows XP, boot-time environment variables should be set with the registry in:
HKEY_CURRENT_USER\Environment (USER environment variables) or:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment(SYSTEM environment variables)
as shown in Microsoft's KB

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .