Environment variable use within VBScript action

I have an environment variable (PROJECTVERSION) set from a Windows batch file prior to that batch file calling FinalBuilder to build my project. Within the various FinalBuilder actions such as TFS get and property set updates I have used that environment variable without a problem. However, when I get to where I have a script action that contains a VBScript I cannot seem to utilized that environment variable or its value–it is always blank. I have tried gathering the environment variables from the user, system, and process levels:

Set objWSH =  CreateObject(“WScript.Shell”)
Set objUserVariables = objWSH.Environment(“USER”)
Set objSystemVariables = objWSH.Environment(“SYSTEM”)
Set objProcessVariables = objWSH.Environment(“PROCESS”)

and trying to get that value several different ways:

  BuildVersion = objUserVariables(“PROJECTVERSION”) & “”
  BuildVersion = objSystemVariables(“PROJECTVERSION”) & “”
  BuildVersion = objProcessVariables(“PROJECTVERSION”) & “”
  BuildVersion = createobject(“wscript.shell”).expandenvironmentstrings("%PROJECTVERSION%") & ""


with variations of the above both with and without the % symbol. Nothing seems to return its value. Any ideas?

Thanks.

Environment (and project etc) variables are available in script events, e.g :

MessageBox FBVariables.COMPUTERNAME,“test”,0

So you do not need to use WScript.Shell to access them.

Thank you. Your suggestion along with some further tweaking of the existing VBScript contents got things working as desired.