查看环境变量
(gc env:path).split(";")
(type env:path) -split ';'
ls env:
$env:computername
$env:userprofile
结果:
C:\Python27\
C:\Program Files\Intel\iCLS Client\
C:\Windows\system32
C:\Windows
C:\Windows\System32\Wbem
C:\Windows\System32\WindowsPowerShell\v1.0\
C:\Program Files\Intel\Intel(R) Management Engine Components\DAL
C:\Program Files\Intel\Intel(R) Management Engine Components\IPT
C:\Program Files\Intel\OpenCL SDK\2.0\bin\x86
C:\Program Files\OpenVPN\bin
%USERNAME% - 当前用户名
%USERPROFILE% - 当前用户主目录
批处理中的环境变量:http://www.cnblogs.com/dreamer-fish/p/4056627.html