Environment Variables Manager Help

Table of contents


1. Introduction

The Environment Variables Manager is a utility for setting up an operating system's environment. It represents environment variables as files and exposes its functions through the Windows shell facilities.

Back to top


2. Definitions

Environment a set of named values which the system and applications use to adjust their execution
Global Environment an environment that is visible globally throughout the system
Local Environment 1) an environment that is visible only within the particular command shell session
2) a set of variable files
Variable File a file that Environment Variables Manager uses to represent an environment variable. The name of the file serves as the name of the variable and the file's contents is the variable's value. Variable files have extension '.sysvar' for system variables and '.uservar' for user variables.

Back to top


3. Installation and removal

Automatic Installation

Use the provided installer to install and remove the product. Uninstallation preserves existing local environments.

Manual Installation

Copy the product's file to desired location and register it with the regsvr32 utility:

regsvr32 evmshell.dll

To uninstall the product, run regsvr32 with the -u option:

regsvr32 -u evmshell.dll

then delete the file. You may need to log off prior to deleting as the shell extension modules are usually locked by shell.

Note: if you are going to install the product to the directory whose path contains the spaces (e.g. 'C:\Program Files') then ensure that the following registry setting is set to zero:

HKLM\SYSTEM\CurrentControlSet\Control\FileSystem\NtfsDisable8dot3NameCreation

This is required to enable opening local environments with a shortcut.
After the product is installed the setting can be restored to the original value.

Back to top


4. Viewing environment

Right-click any file folder (preferably empty) and choose Environment > Dump global environment. The files representing the current environment will be created in that folder:

The contents of variable files is written in UTF-8 encoding with byte order mark.

Another way to get a value of an environment variable is to create a variable file (see Creating Variables) and click Environment > Update variable with global value from its context menu.

Back to top


5. Viewing environment (continued)

Set up a detailed view of the folder:

$Local value Value of the local variable (i. e. the contents of the file)
$Local items Number of the items in the local variable (i. e. the number of non-empty unique lines in the file)
$Global items Number of the items in the corresponding global variable
$Matching items Number of the items in the local variable that exist in the corresponding global variable. If matching items go in different order then the number is marked with an asterisk.

A variable file infotip also displays the counts of local, global, and matching items.

The contents of a selected variable file is also displayed in the preview pane of Windows Explorer (requires Windows Vista or later).

Back to top


6. Comparing variables

You need to create global environment variable ENVDIFF and specify path to comparison utility as its value. EVM will invoke the utility to compare variables.

To compare a global variable to the local one with the same name, right-click a variable file and click Compare to global variable.

To compare entire global environment to a local one, right-click a local environment's folder and click Compare to global environment.

Back to top


7. Editing environment

Variable files can be edited as usual text files. Double-clicking on a variable file opens Notepad loaded with the contents of the file.

Each item of the variable's value should be placed on separate line. Leading and trailing spaces, empty and duplicate lines are ignored. Case is ignored.

Back to top


8. Editing environment with drag-and-drop

A convinient method exists to edit a variable whose value is a set of paths, such as PATH. Drag a folder and drop it on a variable file:

The path to the folder will be appended to the contents of the file:

If a variable file is dropped onto another variable file then its contents instead of path is appended to a target file.

Back to top


9. Replacing values with variables

A prefix of a variable value can be automatically replaced with the reference to the variable whose value matches the prefix. For example, if the PATH variable has the value C:\Windows\system32 and the local environment contains the variable WinDir whose value is C:\Windows, then the value of PATH will be changed to %WinDir%\system32. To perform the replacement click Environment > Unexpand prefixes from the context menu of the directory containing the variable files.

Back to top


10. Creating variable files

To create a variable file, choose New > System environment variable or New > User environment variable, then rename the newly created file.

Back to top


11. Modifying global environment

The changes made in the variable files do not affect the global environment. To apply the changes to the global environment, click Environment > Set global variable from the menu of a variable file:

The display is automatically refreshed and shows that the changes are now globally effective:

Back to top


12. Deleting global variables

To delete a variable from the global environment, select corresponding variable file and click Environment > Delete global variable from the context menu of the file:

The display is automatically refreshed and shows that the variable is now missing from the global environment:

Back to top


13. Modifying process environment

The contents of the variable file can be applied to the environment variable of the process which EVM is running in context of (typically this process is Windows Explorer). To change the process variable, select corresponding variable file and click Set process variable from the file's menu.

To set a process variable to an empty value, click Clear process variable from the same menu.

Back to top


14. Local environments

To work in environment you set up it is not nesessary to make it global. It is possible to fall within the environment by selecting the necessary variables and choosing Environment > Open local environment. In the following example, the PATH variable although is not effective globally, is effective in the current command shell session:

The Open local environment command is also applicable to a folder. In this case all variables in the folder take effect.

Opening local environment with a shortcut

You can create a shortcut to open a local environment with Environment > Create opening shortcut command found in the context menu of the directories. The shortcut is created in the same directory where the selected directory is located under. Opening the shortcut is equivalent to executing the Open local environment command on the directory.

Back to top


15. Special variables in local environments

EnvDir - the path to environment directory. This variable is added to a local environment by EVM and points to a directory containing variable files that make up the environment. If a variable with this name already exists in the local environment then its value is preserved.

StartEnv - the program to execute upon opening local environment. If the value of this variable is valid path to an executable file then that file is executed instead of cmd.exe when the local environment is opened.

WorkDir - the working directory. If the value of this variable is valid path to a directory then that directory becomes working directory of the program that is started when the local environment is opened.

Back to top


16. Wiping out

Environment Variables Manager installs disk cleaner which is accessible through standard Disk Cleanup utility. It allows to delete all the variable files on the selected drive:

Back to top


17. Version history

version 1.4.2 released 25-Jul-2018
Improvements
System environment variables can be modified from the Windows Explorer running with non-administrative rights.
version 1.4.1 released 10-Jun-2015
Fixed critical issue
The values of the global environment variables modified by EVM did not expand.
version 1.4 released 10-Mar-2015
New
New command: Compare to global variable.
New command: Set process variable.
New command: Clear process variable.
View a variable file contents in the preview pane of Windows Explorer.
If matching items in a local and global variables go in different order then their number is marked with an asterisk in "$Matching items" column.
A variable file infotip.
Changes
Variable files are written in UTF-8 encoding with byte order mark.
Command 'Apply variable to global environment' renamed to Set global variable.
Command 'Delete variable to global environment' renamed to Delete global variable.
Modifying global environment no longer requires to manually refresh Windows Explorer display to reflect the changes.
version 1.3 released 10-Jan-2011
New
Added command Create opening shortcut.
Added command Unexpand prefixes.
Changes
The name of the product's DLL file no longer includes the version number and the platform code.
Fixes
On Windows Vista and later systems the custom columns in Windows Explorer might disappear.
version 1.2 released 16-May-2010
New
Windows Vista and later systems are supported.
Changes
The extensions of the variable files (*.sysvar and *.uservar) are always hidden in Windows Explorer.
The last line in a variable file does not need to be terminated with the newline character.
Dropping a variable file onto another variable file appends the contents of the former to the latter.
version 1.1 released 01-Mar-2008
Changes
Added support for special variables - EnvDir, StartEnv, WorkDir.
Fixes
Executing command "Open local environment" leaves open handles to the started process.
Executing command "Open local environment" on a directory leaves open handles to that directory.
version 1.0 released 19-Dec-2006
First release.

Back to top


18. Disclaimer

The software is provided "AS IS" without any warranty, either expressed or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. The author will not be liable for any special, incidental, consequential or indirect damages due to loss of data or any other reason.

Back to top