Reload environment variables

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

Reload environment variables

Post by rclkrtrzckr » 04 Apr 2019 08:42

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: 1241
Joined: 20 Oct 2017 21:14
Location: 1909 x64

Re: Reload environment variables

Post by jupe » 04 Apr 2019 08:50

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: 58
Joined: 03 Jan 2017 13:10
Location: Zurich, Switzerland

Re: Reload environment variables

Post by rclkrtrzckr » 04 Apr 2019 20:56

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: 1241
Joined: 20 Oct 2017 21:14
Location: 1909 x64

Re: Reload environment variables

Post by jupe » 05 Apr 2019 02:55

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