Redmond Lab .Net is a hobby project focusing on software for system administrators, power users, and developers. Use Submit tab to send your questions, comments, or bug reports.
Version 1.0 / Feb 14, 2008
Redmond Path utility makes it easier to edit search path in Windows environment. It provides interactive way for adding, deleting, verifying, and reordering directories. Finally, you can see it all and move things around.
In order to find executable modules and its dependencies, Windows operating system uses PATH and PATHEXT environment variables. It searches through directories listed in PATH and tries to find an executable module with one of the extensions specified in PATHEXT. In both variables items are separated by semicolon ';' character. Order in which items are listed is important. The first match found will be used. Windows allows to define both system global and user specific path settings. The end result is a concatenation of these two variables where system value comes first before the user value.
People who once edited environment variables on Windows, specifically the search path variable know what the problem is. Right, size does matter. It seems like this dialog window was specifically designed to hide the most of the search path so it can play a sick memory game with human mind.
Redmond Path utility provides a solution to this problem by allowing to modify search path locations in interactive and friendly manner. It splits the search path into a list of locations and manages both system and user settings at the same time. The combined view represents what the resulting search path will look like in the end.
While changing the search path, Redmond Path validates each location making sure that it points to a valid directory in the file system. To give a test to created search path, try using Find in Path feature that is equivalent to which and whereis commands on Unix/Linux. It will locate entered command in the search path. Or start a command prompt from Redmond Path and it will propagate the updated search path into the launched command environment.
After modifications are made, submit changes by using either OK, Apply, or Save Changes button. Roll back to the original or last saved state by using Reload button. It will sync up the search path with the current system values. Click on Cancel to avoid any changes to the system.
As discovered while working on this utility, Windows across its all versions has a problem and inconsistency in the way it expands PATH environment variable.
Let's consider an example of using other environment variable in specifying search path locations. For example, this works fine
However, using environment variable in the path that refers to another variable works unpredictably. The following example worked fine
A=C:\tools B=%A% PATH=%B%;C:\Windows
and expanded to
but this one did not work properly
SOMEPATH=C:\tools TOOLS=%SOMEPATH% PATH=%TOOLS%;C:\Windows
and ended up incorrectly in the resulting path, like this
It seems like this behavior depends on the variable names, specifically the first letter they start with. This bug is only seen in setting system search path, while user search path expands transitive dependencies properly.
Redmond Path utility does not try to emulate this Windows bug and will show both system and user paths expanded properly. However operating system may not parse it in expected way. To avoid all these problems, simply do not use variables in the search path that refer to other ones.
Let's review another example of a variable in the search path that expands to a list of directories, like this
It will be shown in Redmond Path as a nested parent node with sub-items. A parent node can be moved, deleted, or changed by itself. However all sub-items inside the parent node will not be available for any changes. Redmond Path does not touch any other environment variables except the PATH variable for both system and user settings.