I have a package which adds and removes an entry (say C:\my_entry) to PATH environment variable during installation and uninstallation respectively. I am able to see that entry is being added/removed to/from PATH variable by verifying the registry key HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\Path.
But I observed different values for PATH environment variable from command prompt.
If I open command prompt as Win+R, Type cmd and then enter, I am able to see C:\my_entry in PATH variable.
If I open command prompt(cmd.exe) from C:\Windows\System32 directory, I am unable to C:\my_entry in PATH variable.
If I open command prompt as Win+R, Type cmd and then enter, I am still able to see C:\my_entry in PATH variable though it got removed from registry.
Please let me know why PATH environment variable value is different if we open command prompt from different locations? And why the PATH environment variable value is different in command prompt from the value present in Registry?