' for example to get the oracle home path
MsgBox GetSystemVariable("ORACLE_HOME")
' =============================================================
' function: GetSystemVariable
' desc : Get the value of a system variable
' params : strSysVar is the variable name
' returns : Content of variable name
' =============================================================
Function GetSystemVariable(strSysVar)
Dim objWshShell, objWshProcessEnv
' create the shell object
Set objWshShell = CreateObject("WScript.Shell")
Set objWshProcessEnv = objWshShell.Environment("Process")
' return the system variable content
GetSystemVariable = objWshProcessEnv(strSysVar)
End Function ' GetSystemVariable
0 comments:
Post a Comment