' +----------------------------------------------------------------------------+ ' | Jeffrey M. Hunter | ' | jhunter@idevelopment.info | ' | www.idevelopment.info | ' |----------------------------------------------------------------------------| ' | Copyright (c) 1998-2011 Jeffrey M. Hunter. All rights reserved. | ' |----------------------------------------------------------------------------| ' | FILE : EnvironmentVariables.vbs | ' | CLASS : Miscellaneous Functions | ' | PURPOSE : Demonstrates how to read environment variables. | ' | PARAMETERS : None | ' | USAGE : cscript EnvironmentVariables.vbs //NoLogo | ' | NOTE : As with any code, ensure to test this script in a development | ' | environment before attempting to run it in production. | ' +----------------------------------------------------------------------------+ Option Explicit Dim g_objShell, strTempVariable Set g_objShell = CreateObject("WScript.Shell") strTempVariable = g_objShell.ExpandEnvironmentStrings("%temp%") WScript.Echo "TEMP = " & strTempVariable Set g_objShell = Nothing WScript.Quit(0)