A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.

Jump to

Quick reference

Windows command prompt get set environment variables

Yuck. I feel dirty writing about the Windows command line, but sometimes you just need to get a job done.

View all environment variables

reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment"

View a specific environment variable, e.g. PATH

reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v PATH

Set an env var locally (not persistent)

set FOO="foo"

Set an env var globally (persistent) - must be run as administrator

setx BAR "bar" /M

View individual local env vars

echo %FOO%

echo %BAR%