I ran into problems hitting the maximum length of the Windows PATH variable. I read an article that suggested extending it by creating another environment variable, say PATH1, adding additional directory paths to that new variable, then adding %PATH1%
to the PATH variable. This works fine: I can see the directories in PATH1 listed when I do echo %PATH%
and applications relying on directories listed in PATH1 seem to work okay.
However, after a few hours Windows File Explorer seems to forget the directories added to the PATH1 variable. I know it works right after a restart because PATH1 includes a directory with shortcuts which I run frequently via the Run dialog. Those shortcuts work for a few hours after a restart. But eventually I'll try to run a shortcut from the Run dialog and get the message Windows cannot find '<shortcut name>'
. After that none of the shortcuts will work again until I restart the machine.
When I get that Windows cannot find '<shortcut name>'
error message I can open a command prompt and run echo %PATH%
. It will still include the directories added to the PATH1 variable. So it's not like Windows as a whole has forgotten the directories in PATH1. It seems to be just File Explorer.
Is there some memory pressure or something that might cause this after a few hours? Is there anything I can do to avoid it?