Skip to content

Instantly share code, notes, and snippets.

@lucacesari
Created September 16, 2014 14:26
Show Gist options
  • Save lucacesari/6e7379388da21775d69d to your computer and use it in GitHub Desktop.
Save lucacesari/6e7379388da21775d69d to your computer and use it in GitHub Desktop.
Add a system enviroment variable in Windows
@echo off
REM Usage: add_env_var.bat NEW_ENV_VAR "my_path"
REM If the inserted path contains spaces remember to quote it
REG ADD "HKLM\SYSTEM\ControlSet001\Control\Session Manager\Environment" /v %1 /t REG_SZ /d %2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment