reading windows environment variables

Could someone please suggest how i could read environment variables from windows? In cmd i can run

“%ovinstalldir%bin\win64\test.bat” -version

However i am attempting to do the same in the irb and not sure how i should do that.

Any help is greatly appreciated.

Thank you

In Irb i am able to run


Returns the correct path 'c:\program files'

THank you for any further help.