Skip to content
⌘ NSIS Forum Archive

envVarName

5 posts

kobus#
This code display value of PATH environment variable

MessageBox MB_OK "$%PATH%"

it is not a big example 🙂
kobus
Comm@nder21#
example:
%ProgramFiles% will give you your program files folder.
in this case the same as $PROGRAMFILES
another example:
%Temp%
same as $TEMP
eccles#
Just emphasising that this is a compile-time reference, not run-time, so $%TEMP% will give the path of your temporary files folder, not that of the person using your installer.
Afrow UK#
If you e.g. %COMSPEC% on run-time (to get user's command prompt path) use:

ReadEnvStr $R0 "COMSPEC"
; $R0 = e.g. C:\Windows\System32\cmd.exe

-Stu