Hopefully "ScriptingTipsAndTricks" helps you with your batch file or vbscript scripting :-)
[Bottom][Contents][Prev]: Dictionary Objects - store and retrieve information under a key[Next]: LPad0() - Pad a value with zeros but never truncate
\->VBSCRIPT Files->GetEnv() - Get Environment Variables

[anchor]

The Code for: "GetEnv() [Get Environment Variables].vbs.txt"

This is the example, a shortcut was installed to this code :

'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
' $Header:   C:/DBAREIS/Projects.PVCS/Win32/ScriptingTipsAndTricks/EXAMPLE[vbs].GetEnv() [Get Environment Variables].vbs.txt.pvcs   1.0   11 Jul 2014 19:31:06   USER "Dennis"  $
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

dim oShell : set oShell = CreateObject("WScript.Shell")



'============================================================================
function GetEnv(EnvName)
'============================================================================
   dim Try
   Try    = "%" & EnvName & "%"
   GetEnv = oShell.ExpandEnvironmentStrings(Try)
   if  GetEnv = Try then
       GetEnv = ""
   end if
end function


Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006, 2007, 2008 & 2009 for the Windows SDK (Windows Installer) area.Please email me any feedback, additional information or corrections.
See this page online (look for updates)

[Top][Contents][Prev]: Dictionary Objects - store and retrieve information under a key[Next]: LPad0() - Pad a value with zeros but never truncate


ScriptingTipsAndTricks© is (C)opyright Dennis Bareis 2003-2008 (All rights reserved).
Sunday September 07 2014 at 12:50pm
Visit ScriptingTipsAndTricks's Home Page
Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006, 2007, 2008 & 2009 for the Windows SDK (Windows Installer) area.