Set Environment Variables

In case you have to explain someone how to set environment variables, who is not familiar with it, this script could save you some time.


Future Ideas:

It would be great if the script could also remove something from the path variables. Batch is not suitable for this, but I will do further considerations.

In a short test on a VM, just copying the command "pathman" to a Windows 10 system worked smoothly and no installation of the Windows Resource Kit was needed.

Additionally, unlike setx, pathman has a decisive advantage. Setx is unable to add more characters to path variables longer than 1024 characters. Even if the path variable already is much longer, setx would simply truncate it.

For now, i will provide two scripts. One based on setx, the other on pathman. In the setx variant i built in some handlings which will keep you away from destroying your PATH variable. Please take a look at the comments and jumpmarks in the script for further information.




Windows Server 2003 Resource Kit Tools | Microsoft

Windows Server 2003 Resource Kit Tools | Mirror