Reload environment variables

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
rclkrtrzckr
Posts: 65
Joined: 03 Jan 2017 13:10
Location: Zurich, Switzerland

Reload environment variables

Post by rclkrtrzckr »

Hi all

We have a pretty weird setup here in our company, with quite a few windows environment variables involved. I faced a problem yesterday when I had to create windows shortcuts (.lnk) using variables I set on the command line with setx. The shortcuts were only working when I restarted XYplorer - or used windows explorer.

To reproduce my struggle, you can create a variable and a shortcut and see how it works:
  • Code: Select all

    SETX XYPLOREREXE "<path to your exe>"
  • Create a shortcut that opens anything
  • Edit the shortcut, replace the command by

    Code: Select all

    %XYPLOREREXE%
It would be great to have a command to reload all environment variables. Maybe there is one, I didn't find anything.

Cheers

André

jupe
Posts: 2757
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Reload environment variables

Post by jupe »

If you did a forum search prior to your post you might have found this topic, where the issue was discussed previously:

viewtopic.php?f=2&t=18439#p156284

rclkrtrzckr
Posts: 65
Joined: 03 Jan 2017 13:10
Location: Zurich, Switzerland

Re: Reload environment variables

Post by rclkrtrzckr »

I did, but not properly apparently.

That's sad news. I actually thought this would be an easy thing to do. My favourite keyboard launcher Keypirinha can do this, on demand of course.

http://keypirinha.com/index.html or http://keypirinha.com/packages/env.html

Cheers

André

jupe
Posts: 2757
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Reload environment variables

Post by jupe »

Well if the main issue is lnk files, in theory as a workaround you should be able to write a script to read the enviro variables from the registry, read the shortcut target, and manually resolve (ie. replacelist) the variables and run/goto the target via PFA which should be seamless from your point of view, once setup.

Post Reply