Search code examples
bashshellwindows-8cygwin

Can I use the environment variable %PROGRAMDATA%?


I type:

echo $USERPROFILE and get C:\Users\rob

echo $PROGRAMFILES and get C:\Program Files (x86)

echo $PROGRAMDATA and get nothing.

Under windows %PROGRAMDATA% evaluates to C:\ProgramData

Why are some windows environment variables supported and not others, or am I just doing something wrong here? If not, is there a list somewhere of which ones are converted for use under cygwin?


Solution

  • It is mixed case

    $ set | grep -i programdata
    ALLUSERSPROFILE='C:\ProgramData'
    ProgramData='C:\ProgramData'
    
    $ echo $ProgramData
    C:\ProgramData