I'm trying to set an env variable which I want it to be reachable from another windows shell (which is already opened) :
I have tried:
os.environ['start'] = 'test'
Then in a Windows cmd : env.exe | findstr 'start' returns nothing. Variable 'start' does not exist.
Then I tried:
subprocess.call(['setx.exe', 'start', 'test'])
SUCCESS: Specified value was saved
env.exe | findstr 'start' still returns nothing.
How can I get this variable from a windows shell ? Using Windows 10 and python 3. Thanks!
WM_SETTINGCHANGE"Environment" message to top-level windows. This includes the Windows shell, Explorer, which reloads its environment from the registry. It does not include console applications such as cmd.exe, which do not create or own any top-level windows.