logo

How to Reference Environment Variables in Windows 📂Programing

How to Reference Environment Variables in Windows

Guide

${env:변수명}을 통해 ‘변수명’이라는 이름을 가진 환경변수를 참조할 수 있다. 예를 들어, 윈도우즈에서 사용자 이름을 가져오고 싶다면 ${env:USERNAME} can be used.

Example

PS C:\Users\rmsms> echo ${env:USERNAME}
rmsms
PS C:\Users\rmsms> echo ${env:JULIA_NUM_THREADS}
16