函数参考


EnvGet

返回指定的系统环境变量的值.

EnvGet ( "环境变量" )

参数

环境变量 环境变量名,比如"TEMP" 或 "PATH".

返回值

返回指定变量的值(若该变量并不存在则返回空字符串).

注意/说明

None.

相关

EnvSet, EnvUpdate

示例/演示


Example()

Func Example()
    ; Retrieve the value of the environment variable %APPDATA%.
    ; When you assign or retrieve an envorinment variable you do so minus the percentage signs (%).
    Local $sEnvVar = EnvGet("APPDATA")

    ; Display the value of the environment variable %APPDATA%.
    MsgBox(4096, "", "The environment variable %APPDATA% has the value of: " & @CRLF & @CRLF & $sEnvVar) ; This returns the same value as the macro @AppDataDir does.
EndFunc   ;==>Example