PathEditor User Manual

Update: August 15th, 2010

Brief Introduction

PathEditor is not a big complicated environment management tool.  If I wanted that I’d just use the Rapid Environment EditorPathEditor is a small utility without fancy skins and stuff that just edits your system path  (and other lists in the registry if you want).  Nothing to fancy or complicated.

PathEditor, in it’s most basic mode, really doesn’t need a user’s manual.  You should be able to easily figure out everything that is can do.  (If not, please drop me a note and let me know what isn’t clear or obvious).  Almost every control has helpful tooltips that explain what they do.

PathEditor can be run in two modes, basic and advanced.  In basic mode PathEditor only allows for editing your system and user path.  In advanced mode, you can edit any registry entry in the HKCU registry domain, and there are additional methods of specifying variable substitution. (This was done for a user who wanted to more easily edit several registry entries that define search paths within the Delphi Development Environment, and this will be used in the feature explanation below as an example.)

Basic Mode

Basic mode is the default mode that PathEditor starts in after you first install the application.  If you only want to edit your Path then there is no reason to ever turn on advanced mode.  Advanced mode doesn’t provide any additional functionality for editing your path.  The screenshot below shows PathEditor in basic mode (although your path list will surely be different).

 

image

As you can see the User Interface is not very complicated.

Your PATH is made up of two parts.  The System Path (which is common to all users of the system) and the User Path (which is unique to your user account).  These two paths are combined using some internal Windows magic to create the path that is given to an executing program’s environment.

I don’t about most people (though I do suspect this is so) but I almost always use the System path exclusively and leave my user path empty.  (One reason is that any changes to the User Path appear to require a “log out log in” to effect the changes, whereas changes to the system path get picked up when a new process is started.  But mostly because all the systems I work on are generally single user systems.)

There are two lists displayed within the application window.  The upper list contains the entries in the system path. The lower list contains the entries in the user path.  You can move items between the lists by dragging the item from one list to the other.

User Controls

Each of the User Controls is described…

The Lists

The lists show the entries in the path.  Each item has a small icon on the left side that indicates the current status of the items.  The (contrived) screenshot below shows examples of these status indicators:

Screenshot - 8_14_2010 , 9_31_19 PMThe first line (c:\eclipse\bin) has a folder icon with a small red X.  This indicates that the directory pointed to by this entry is missing.

The second and forth entries are duplicates.  They are indicated by the folder icon with a small warning sign.  The second entry is the selected entry and you will notice that the background color of the duplicate entry has a different color to indicate that it is the duplicate entry of the selected one. One of the duplicates should be removed.

The third entry has quotes.  Path entries do not need to be quoted and can cause unforeseen (and hard to diagnose) problems.  Some installer packages still quote path entries when adding them to the registry.  Notice that the cursor is floating on the entry with the quotes.  The displayed tooltip explains why the list entry has a warning icon.

Active

When both lists are displayed (you can hide the user list if you want, see below), you’ll see the word Active displayed at the top right of one of the lists.  This indicates which list will be affected when you press the Up, Down, Add, or Delete buttons.  You can change the active list by simply clicking anywhere in the list.

If only one list is displayed (you can do this, but you’ll have to read on to find out how) the Active indicator is not displayed.  The implication being that all actions will affect the only displayed list.

Up/Down Buttons

These button moved the selected entry up or down in the list allowing you to reorder the entries.  You can also drag and drop entries to reorder them. 

Add Directory

Use this button to add a new directory to the path.  A dialog window will open to allow you to browse to and select the directory to add. The new directory will be added above the currently selected entry, or at the end of the list if no entry is selected.  You can also hit the [Insert] key on the keyboard to accomplish the same thing.  You can also drag a directory from any Windows explorer window into the list and drop it where you want it inserted (it will be inserted before the entry you drop it on).

Delete Directory

Use this button to delete the selected entry from the list.  Or use the [Delete] key shortcut.

Clean

This will clean your path.  Any entries pointing to missing directories will be deleted.  Any duplicate entries will be removed (leaving the first occurrence).  Any path entries that are quoted will be stripped of their quotes.  When you press the Clean button a dialog is displayed listing all the actions that will take place during the cleaning process.  You should review this list carefully and ensure that you agree with the actions.  Here’s and example (based on the erroneous entries in the previous screenshot:

image

If you press OK, the cleaning will continue (and you can still undo it if you decide to).  If you press Cancel, nothing will be cleaned.

Undo/Redo

Undo and Redo any edits that you’ve made.  You can undo everything you’ve done all the way back to when you first opened the application.

Explore Folder

Press this button to open a Windows Explorer window on the selected directory.  You can also just double-click the entry to do the same thing.

About

Open the About Box for this application.  This is a very important feature because this is where you can make a donation to the PathEditor Development Fund. 

Save To Registry

After you’re convinced that all your changes are good, press this button to commit everything to the registry.  And remember that, although changes are committed to the registry, you’ll need to restart most applications that use the path in order to pick up the changes.  (Because an application usually gets a copy of the environment only at startup.  If the master environment changes, the application won’t see the change until restarted.  Some apps are smart enough to receive notification of environment changes and PathEditor does broadcast the notification change message).

On “mature” systems, the broadcast message can take quite a while to complete.  A dialog box will be displayed when the broadcast is complete.  On young, pure systems, this happens very quickly.

Show Tool Tips

This checkbox just enables (or disables) the display of tooltips on all the controls.  The tooltips are very useful early on as you’re figuring out the application, but once you know what your doing, you’ll probably want to turn them off.

Expand Env Vars

This checkbox enables (or disables) display of expanded environment variables in the path.  You can see in the screenshot above that a few of the entries reference %SystemRoot%, if you check this box then that reference will be replaced with the value of the %SystemRoot% variable.  When entries contain expanded environment variables they cannot be edited.  Speaking if editing…

Editing List Entries

There is no button for this.  But you can edit the text of any entry (except those that contain expanded environment variables) by slow-double-clicking on the entry, or hitting F2.   Entries that contain expanded environment variables will have a different background color to let you know that this is the case.  You can also right-click on an entry and select “Edit item” from the context menu.

Context Menu

Right-clicking on an entry in either list will bring up a context menu for the entry.  This menu will contains any of the following items (whether or not they are displayed depends on the context of the item)

Edit Item

Starts editing the selected item.  This menu item is only present if the item does not contain any expanded environment variables.

Insert New Item

Inserts a new item above the selected item and immediately begins editing the item.  Use this when you feel like typing fully qualified directory names by hand. (Or when editing non-path type lists in Advanced Mode.)

Copy to Clipboard

Copies the selected item to the clipboard.

Copy to Clipboard (expanded)

This will expand any environment variables in the entry prior to copying it to the clipboard.

Main Menu

Each of the Basic Mode Main Menu choices is described…

File Menu

Save To Registry

Saves changes to the registry. See Save To Registry above

Exit

Exits the application, asking if you want to save changes if necessary.

Options Menu

Set List Font…

This menu item allows you to set the font used for both of the lists using a standard Windows font selection dialog.  Your choice is saved and will be restored the next time you start the application.

Hide User Path List

This is a checkbox menu item that, when checked, hides the user path list.  Since I rarely (if ever) use this list, I keep it hidden all the time.  This setting is saved and restored when the application is restarted.  When the application is first started, the user path list will be displayed.

Enable Advanced Mode

Checking this menu item turns on the uber-scary non-intuitive advanced mode.  Proceed with caution!  OK, it is not that scary, but the advanced mode options do need some ‘splaining.  Fortunately there is an entire second half of this manual to do that.  If you just want to edit your path, don’t check this box.  If you do check it, then you have to confirm once more that you really want to do this (even after reading the warning dialog that is displayed):

image

 

Help Menu

Really? Do I need to explain the items on this menu.  Well OK..

About

Displays the same about box that the About Button displays.  As I mentioned before, this is a very important and crucial part of PathEditor because this is where you can make a donation to the PathEditor Development Fund.

PathEditor Homepage

This will open you default browser and navigate to the PathEditor homepage.

Check For Updates

This will check to see if there is an updated version of PathEditor published and available for download.  Check back often!

 

OK. That about covers it for the basic mode operation of PathEditor.  If you just want to edit your path, you don’t need to read any further.

 

Advanced Mode

First a little history

The advanced mode of PathEditor enables features that users have requested over time.  My original goal for path editor was to keep it simple, but as more people requested features the UI got a little more messy.  For a while PathEditor did not have a basic mode and an advanced mode and that led to confusion and declarations that PathEditor was non-intuitive and poorly designed.  But that has all been remedied now.  If you don’t enable advanced mode, then everything is pretty intuitive (although I’m sure there will always be some “intuitively obvious” feature missing in someone’s opinion).  So, anyway, this section is about the advanced mode.

Moving On

Let’s start with another screenshot showing what happens when you enable advanced mode:

image

Looks a lot different, doesn’t it.  No really, there are two brand new menus on the main menu bar: Variables and Mappings.

Now’s the perfect time to turn back and disable Advanced Mode.

OK.  The Variables menu allows you to select different registry keys to edit.  You are not limited to just values in your environment (though you can edit those too).  You can select any registry key within the HKCU domain.

The Mappings menu (in combination with a mappings file that you will craft) provide a advanced ways of resolving variable substitution in list entries.  This will be explained in more detail, with examples, below.

Variable Menu

Select Variable…

This menu item is a shortcut to selecting a different named value from the currently selected registry key, for instance a different environment variable from the Environment Key.  In fact, if you are editing the Path, then this is exactly what will happen when you select this menu item.

Selecting the menu item brings up a dialog with the variable names listed:

image

Initially the list will only contain entries that look like lists of semi-colon separated directories (unless no such entries are found, in which case all variables are listed).  If you press the [Show All] button all variables will be listed and you can select any one of them (even if they technically are not path lists).  The [Show All] button will be renamed [Show Paths].  You can imagine what happens if your press the [Show Paths] button.

Open Registry Key…

This menu item lets you venture out beyond simply editing the system environment variables.  From here you can browse through the entire HKCU domain and edit any registry key you want.  Selecting this menu item will open the Enter Registry Key dialog.  It looks something like:

image

In this example I’m using the RedfernPlace registry key as an example.  This is where I store the application preferences and settings for my software.  The Subkeys list is dynamic and updates as you are typing to show you all the possible completions for the current input.  When there is only a single subkey listed in the box, you can simply hit [Enter] to complete the entry.

The Values list shows you each of the name/value pairs underneath the currently selected subkey. This list is also dynamic and updates as you type.

The key entry box has a dropdrop down that stores previous selected registry keys so you can easily see where you’ve been and get back there quickly.

The [Clear History] button will clear the registry key history in the dropdown when it get too long and cluttered (and less useful).

Once you’ve decided which registry key you want to work with, click the [OK] button (or click the [Cancel] button if you’re being indecisive).  If you clicked [OK] you will immediately be presented with the Choose Variable… dialog describe just above and you can then choose which variable to work with.

Open Recent Registry Key

This menu item is really a submenu that lists the 10 most recently edited registry-key/variable pairs, with the most recent listed first.  You can select any entry in the list and immediately begin editing it.

At the top of the menu is a separated entry titled Edit this list.  Selecting this will load the MRU list into the list editor for you to edit (or simply delete).

Edit System Path

Finally there is the Edit System Path menu item.  This is like the home button on your browser.  It takes you back to that comfortable starting point.  Back to what PathEditor was built to do…editing your system Path.

In fact, if you want to exit Advanced Mode, you have to select this item first in order to enable the Options menu item that disables Advanced Mode.  But don’t worry about remembering this detail.  If you try to disable Advance Mode before going back the System Path a dialog message will remind you.

Mapping Menu

The Mappings Menu has three menu items:

Set Mappings…

Loads a mappings file.  A File Open dialog is present so that you can locate and select a mappings file to load.  Only one mappings file can be loaded.  When you load a mappings file any previously loaded mappings are lost.  A loaded mappings file is remembered and will automatically be reloaded the next time PathEditor is started.

Show Mappings…

Opens a dialog box and displays all mappings as parsed from the loaded mapping file.  This is just a debugging aid to help you see if you’ve constructed your mappings file correctly.

Clear Mappings

Clears any loaded mappings (and forget the file so it won’t be loaded next time).

So let’s try to explain a real world case for how to use this mappings thing.  The user who originally requested this feature really wanted an easier way to edit the BrowsingPath and SearchPath in Delphi.  (I’ve never used Delphi so forgive me if this doesn’t come across very clearly as I don’t really know what these paths are used for).  These paths contains references to values stored in other registry keys.

So, for instance, the SearchPath might look like:

$(DELPHI)\src\vcl;$(DELPHI)\……

And the value of the $(DELPHI) term might be stored in the data for the RootDir value in this registry key:

[HKEY_CURRENT_USER\Software\Borland\Delphi\7.0]

Where the key contains a value/data pair like this:

RootDir=C:\Borland\Delphi

What the mapping file does is provide the facilities to map a term to a value (or to data pointed to by a registry named value.  So below is an example mappings file (with documentation…read it).

An example mappings file that accomplishes this:

# This is an example mappings file for PathEditor. Mappings
# provide a mechanism for mapping a term that may occur in
# a path to an actual directory on the system (in the same
# way that environment variables can be used in the system
# path).

# The mappings file can contain two types of entries. This
# is an example of the first type, a registry key.  A registry
# key must have values that are key/value pairs where the key
# becomes the term that is remapped to the value.
[HKEY_CURRENT_USER\Software\Borland\Delphi\7.0]

# The second type of entry is a simple key/value pair where
# the key is mapped to the value specified.  If the value
# is also a key in a previous defined map, then the value
# is remapped to the mapped value.  For example, using the
# example below, if Roodir is a key defined by the registry
# key above, then the $(DELPHI) term will be remapped to the
# value from the registry key.  Because:
# $(DELPHI) ==> RootDir ==> RegistryKeyValue
$(DELPHI)=RootDir

Remember that the second type of entry does not have to point to a named value within some previously specified registry key.  It can be a simple text substitution if that is all that is required.

So now when a Delphi user loads the BrowsingPath into PathEditor the $(DELPHI) term will be remapped to RootDir which will be remapped to the data value of the RootDir entry in the specified registry key.

Since that explanation makes total sense there is probably no need to mention that when PathEditor was installed on your system an (much simpler) example mappings.txt file was installed as well as some example registry keys and a readme.txt that looks a whole lot quite similar to the example above.  Take a look at the readme.txt file, it contains instruction on how to load the mappings file and which registry keys are created.  You can load these into PathEditor and see (hopefully more clearly) how it all ties together.

Command Line Parameters

PathEditor supports several command line parameters.  The idea behind these parameters is to let you setup up shortcuts to start PathEditor in a specific mode, or to edit a specific key, or to automatically clean and exit (without ever displaying a window).  Each command line parameter is described. 

/e <variable>

Specifies the name of the variable to load on startup.  If not specified then the last edited variable is loaded.  If you wanted PathEditor to always start out editing the Path, then you could make a shortcut that specifies “/e PATH”.

/s <separator-character>

If, for some reason, you wanted to edit a list variable that uses something other than a semi-colon to separate entries in the list, then you can specify this other character with this command line parameter.

/r <registry-key>

If you want to start PathEditor and load a variable from a different registry key (within the HKCU domain) you can specify the key using this parameters.  This works in conjunction with the /e parameters, so your would specify the key using /r and the variable using /e

/c

Starting PathEditor with the /c command line parameter causes PathEditor to automatically and silently clean your path.  No application window is opened, no confirmation dialog is presented.  Use this with caution.

Comments are closed.
TOP