I can't figure out how to get to the PATH variable in an NSIS script. Here's what I tried, but it returns 'error' in $0:
nsExec::ExecToStack 'echo %PATH%'
Pop $0
MessageBox MB_OK "$0"
Also tried escaping the % signs with $s, to no avail. Putting just some string instead of %PATH% also does not work. I saw a suggested example just like this one using Exec instead of ExecToStack, but that did not work either. What am I missing?