CMD opened by XYplorer does not react to the changes of the system variable
-
- Posts: 27
- Joined: 05 Jan 2017 02:52
CMD opened by XYplorer does not react to the changes of the system variable
It seems cmd windows opened by XYplorer (toolbar button or ctrl+alt+p), does not react to system variable change no matter how many times I restart the cmd window(still by XYplorer).
I must restart XYplorer to make the system variable change to work.
And when I start a cmd window from start menu, I do not have to restart explorer.exe to make the changes to work. is this a bug?
I must restart XYplorer to make the system variable change to work.
And when I start a cmd window from start menu, I do not have to restart explorer.exe to make the changes to work. is this a bug?
Re: CMD opened by XYplorer does not react to the changes of the system variable
As a workaround that could work, if you are not already aware you can hold Shift+RClick a folder and select "Open Command Window here" from the shell context menu.
Re: CMD opened by XYplorer does not react to the changes of the system variable
It's not a bug. The cmd inherits the environment from XY. But that doesn't mean that the current behavior can't be improved.
XY could listen to the WM_SETTINGCHANGE broadcast message...
XY could listen to the WM_SETTINGCHANGE broadcast message...
One of my scripts helped you out? Please donate via Paypal
-
- Posts: 27
- Joined: 05 Jan 2017 02:52
Re: CMD opened by XYplorer does not react to the changes of the system variable
Thanks. I see.
And it seems TC does not have this currently...
And it seems TC does not have this currently...
Re: CMD opened by XYplorer does not react to the changes of the system variable
This command could possibly help in your situation:
View | Caches | Refresh Environment Variables
View | Caches | Refresh Environment Variables
Re: CMD opened by XYplorer does not react to the changes of the system variable
Code: Select all
View | Caches | Refresh Environment Variables
then start a dos box from XY and use "set" in it doesn't reflect the OS environment update...
One of my scripts helped you out? Please donate via Paypal
Re: CMD opened by XYplorer does not react to the changes of the system variable
Sorry, I should have known you'd tried that already, in fact I should have tried before I suggested it, was just being lazy....
Re: CMD opened by XYplorer does not react to the changes of the system variable
You may be interested in a little more background information on using environmental variables in XYplorer. viewtopic.php?f=5&t=9082 There's also this thread that discusses having an "Environmental Refresh" that would actually reread the environment as XY does when started from scratch viewtopic.php?f=2&t=13377
Windows 11, 23H2 Build 22631.3447 at 100% 2560x1440
-
- Site Admin
- Posts: 60567
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: CMD opened by XYplorer does not react to the changes of the system variable
I'll add that in next beta.highend wrote:It's not a bug. The cmd inherits the environment from XY. But that doesn't mean that the current behavior can't be improved.
XY could listen to the WM_SETTINGCHANGE broadcast message...
FAQ | XY News RSS | XY Twitter
Re: CMD opened by XYplorer does not react to the changes of the system variable
Hi Don, if I run the following which creates an environmental variable MYVAR and sets it as [home] and then perform an environmental refresh (#505), XYplorer still doesn't see it until a restart. It's not listed in XY's Help | Environmental Variables either. I do see the status message come up, but XYplorer is not seeing the new environmental variable. The command does work since it is listed immediately in Windows under Control Panel | System | Advanced System settings | Environmental Variables. Of course there, it's listed under "user" environmental variables not "system" environmental variables.
Code: Select all
run "cmd /c /q set MYVAR= & setx MYVAR [home]",,0,0;
#505;
echo %MYVAR%;
Windows 11, 23H2 Build 22631.3447 at 100% 2560x1440
Re: CMD opened by XYplorer does not react to the changes of the system variable
Can confirm it here...
Doing a change inside Control Panel | System | Advanced System settings | Environmental Variables,
e.g. adding a new environment variable for the current user
will inform XY but it isn't able to accesss it / show it, etc.
Doing a change inside Control Panel | System | Advanced System settings | Environmental Variables,
e.g. adding a new environment variable for the current user
will inform XY but it isn't able to accesss it / show it, etc.
One of my scripts helped you out? Please donate via Paypal
-
- Site Admin
- Posts: 60567
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: CMD opened by XYplorer does not react to the changes of the system variable
Same here. I just researched this and surprisingly this seems to be by design. Each process is protected against changes of these variables from the outside, so it can rely on the values as long as it lives:
See MS:
https://msdn.microsoft.com/de-de/librar ... s.85).aspx
And some discussion:
https://social.msdn.microsoft.com/Forum ... arpgeneral
The only workaround seems to be to read the registry directly. But that would undermine the design.
This could mean that I should remove "View | Caches | Refresh Environment Variables" since it's utterly useless.
See MS:
https://msdn.microsoft.com/de-de/librar ... s.85).aspx
And some discussion:
https://social.msdn.microsoft.com/Forum ... arpgeneral
The only workaround seems to be to read the registry directly. But that would undermine the design.
This could mean that I should remove "View | Caches | Refresh Environment Variables" since it's utterly useless.
FAQ | XY News RSS | XY Twitter
-
- Site Admin
- Posts: 60567
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: CMD opened by XYplorer does not react to the changes of the system variable
So, I will remove that function since it does not work, and never did. If you have had other experiences speak up now...admin wrote:This could mean that I should remove "View | Caches | Refresh Environment Variables" since it's utterly useless.
FAQ | XY News RSS | XY Twitter
Re: CMD opened by XYplorer does not react to the changes of the system variable
Since you have now removed the function, will you be removing the listener for WM_SETTINGCHANGE just for for enviro variables?, because I keep getting this message and sometimes it overwrites a message I want to read from a script, I assume that it isn't needed anymore?
I think I see this message frequently because explorer keeps crashing on my rig, so when it reloads it must send out the broadcast, but I don't see the message instantly, it pops up a little while later, anyway I assume that is the cause because I am not changing them myself.
I think I see this message frequently because explorer keeps crashing on my rig, so when it reloads it must send out the broadcast, but I don't see the message instantly, it pops up a little while later, anyway I assume that is the cause because I am not changing them myself.