Using Windows environment variables in E3 scripts.

Environment variables are operational system’s variables that contain information about the system, such as specific directories, the logged user’s name, and the current date. You can use these variables in the E3 scripts via VBScript’s ExpandEnvironmentStrings function. For example:


Set oShell = CreateObject(“WScript.Shell”)
temp = oShell.ExpandEnvironmentStrings(“%TEMP%”)
programfiles = oShell.ExpandEnvironmentStrings(“%PROGRAMFILES%”)

In this example, the temp variable save a string containing the path to the logged user’s temporary files folder and the programfiles variable save a string containing the path to the Windows’ Program Files folder. This can be useful to standardize scripts that use system pathnames, regardless the Windows’ language.
Print Friendly, PDF & Email

Este artigo foi útil? Was this helpful?

Classificação média - Average rating 0 / 5. Count: 0

Leave a Reply

Your email address will not be published.Required fields are marked *