CMD opened by XYplorer does not react to the changes of the system variable
Forum rules
You might want to read this if you're looking for priority service
Please Include The Following Information
1) Your XYplorer Version (e.g., v28.00.0801)
2) Your Windows Version (e.g., Win 11)
3) Your Screen Scaling Percentage (e.g., 125%).
Use Your Profile Or Signature
We strongly recommend adding your Windows Version and Screen Scaling Percentage to the Location field in your Profile or to your Signature. That way, you only have to type them once, and we won't have to search for that vital information.
How To Attach Images
When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".
You might want to read this if you're looking for priority service
1) Your XYplorer Version (e.g., v28.00.0801)
2) Your Windows Version (e.g., Win 11)
3) Your Screen Scaling Percentage (e.g., 125%).
We strongly recommend adding your Windows Version and Screen Scaling Percentage to the Location field in your Profile or to your Signature. That way, you only have to type them once, and we won't have to search for that vital information.
When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".
-
hyzhangzhy
- 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?
-
jupe
- Posts: 3565
- Joined: 20 Oct 2017 21:14
- Location: Win10 22H2 120dpi
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.
-
highend
- Posts: 15016
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
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
-
hyzhangzhy
- 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...
-
jupe
- Posts: 3565
- Joined: 20 Oct 2017 21:14
- Location: Win10 22H2 120dpi
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
-
highend
- Posts: 15016
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: CMD opened by XYplorer does not react to the changes of the system variable
Code: Select all
View | Caches | Refresh Environment Variablesthen 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
-
jupe
- Posts: 3565
- Joined: 20 Oct 2017 21:14
- Location: Win10 22H2 120dpi
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....
-
klownboy
- Posts: 4477
- Joined: 28 Feb 2012 19:27
- Location: Windows 11, 25H2 Build 26200.8737 at 100% 2560x1440
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
-
admin
- Site Admin
- Posts: 67144
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @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 X
-
klownboy
- Posts: 4477
- Joined: 28 Feb 2012 19:27
- Location: Windows 11, 25H2 Build 26200.8737 at 100% 2560x1440
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%;-
highend
- Posts: 15016
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
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
-
admin
- Site Admin
- Posts: 67144
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @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 X
-
admin
- Site Admin
- Posts: 67144
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @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 X
-
jupe
- Posts: 3565
- Joined: 20 Oct 2017 21:14
- Location: Win10 22H2 120dpi
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.
To see the attached files, you need to log into the forum.
-
admin
- Site Admin
- Posts: 67144
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
XYplorer Beta Club