I am looking for a comfortable editor for all environment variables defined in Windows. The default method to edit them is rather annoying me. Does anyone know something like that?

  • What is annoying about it? – Stephen Jennings Aug 25 '11 at 14:15
  • Lack of: search engine, sectioning by semicolon (in case of PATH)... – IProblemFactory Aug 25 '11 at 14:20
  • Nothing will change the semicolon delimited path. It might present it a different way, but it will always be stored that way. – EBGreen Aug 25 '11 at 14:22
  • I smell XY problem. – Hello71 Aug 25 '11 at 14:23
  • 1
    @Hello71 nope, I really want to get simple and comfortable tool for edit system env. ;) – IProblemFactory Aug 25 '11 at 14:26

In a quick search of the web, there appear to be few such apps.

Rapid Environment Editor doesn't require installation and is the only result in the first two pages of a google search for "modify windows 7 environment variables app".

Environment Variables can be set using PowerShell and Batch scripting. I assume vbscript can do it as well. It shouldn't be too hard, if you have a favorite language, to script such an input.

| improve this answer | |
  • +1: Nice, and it's free (well, donation-ware). Now if I just had a reason to regularly keep changing my environment variables I'd use it! ;) – Ƭᴇcʜιᴇ007 Aug 25 '11 at 15:32

The best way that I know of for handling environment variables on a machine with Powershell (which your W7 machine has) is to use, well, Powershell. Here are some examples based on your comments.

Want to search all the env variables for any theat has Temp somewhere in the value?

Get-ChildItem env: | Where-Object{$_.Value -Like '*temp*'}

Want to see the path variable without the semicolon delimeters?

| improve this answer | |
  1. Create a batch file (ie: setter.bat) containing the following:

    @echo off
    setlocal enableextensions enabledelayedexpansion
    for /F "tokens=1,2* delims==" %%i in (envvars.txt) do setx %%i "%%j"
  2. Open a command prompt, and navigate to where you saved the above batch file.

  3. Type Set > envvars.txt to export your list of environment variables to a text file named "envvars.txt".
  4. Open envvars.txt in you favorite text editor and change things as you would like.
  5. Save the changes.
  6. Run the batch file (setter.bat) to apply your changes.
  7. They will take effect immediately; but not to the currently open command prompt window(s). Open a new command prompt to verify.

The batch file iterated through the exported list you modified, for each line it splits it at the "=" and then uses SetX to set the environmental variables (regular "set" only sets them for the scope of the batch file).

From there you can make additional changes by re-exporting, or changing the existing envvars.txt, and running the batch file again.

Note: Keep a copy of your original export file (as a backup). :)

| improve this answer | |

In my opinion, the best way to set enviroment variables is just using "SETX" from a command window(cmd), this way you dont need to install any third-part softwares to manage Windows settings:

Set environment variables permanently

SETX can be used to set Environment Variables for the machine or currently logged on user:

   SETX Variable Value

   SETX Variable Value -m

     -m  Set the value in the Machine environment (HKLM)
         Default is User (HKCU)
| improve this answer | |
  • 1
    Problem: "Changes made with SET will remain only for the duration of the current CMD session." – Hello71 Aug 25 '11 at 14:46
  • 2
    This is not true. From Setx /? and my experience "On a local system, variables created or modified by this tool will be available in future command windows but not in the current CMD.exe command window." – EBGreen Aug 25 '11 at 16:22
  • "Changes made with SET..." is true of SET. SETX is a different program, that is designed to edit the spot in the Registry where the default environment variables are stored persistently. Use SET to change variables in a particular running copy of the command prompt (or a batch file). Use SETX to change the default environment seen with a new command prompt (or any other program) first starts. – RBerteig Aug 25 '11 at 21:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.