Windows utility written in Go to poke environment variables into the registry.
There are no dependencies.
go get github.com/tischda/pokenv
Usage: pokenv [-h] [-c] [-m] [-f infile]
OPTIONS:
-c
-checkpaths
check if values are valid paths on this system
-f string
file containing the variables to load into the Windows environment (default "REQUIRED")
-h
-help
displays this help message
-m
-machine
specifies that the variables should be set system wide (HKEY_LOCAL_MACHINE)
-v
-version
print version and exit
Examples:
# pokenv.exe -f data\setvar.txt
Setting `POKE_SECTION` to `valueline1`
# pokenv.exe
[MYVAR]
value1
value2
^Z
Setting `MYVAR` to `value1;value2`
# pokenv.exe
[MYVAR]
^Z
Deleting MYVAR
The input file has the following format:
# This is a comment
[Path]
C:\Windows\SYSTEM32
C:\Windows
C:\Windows\SYSTEM32\WBEM
C:\Windows\System32\WindowsPowerShell\v1.0
[TODELETE]
# nothing here means delete this variable
This is also the format generated by peekenv.