AppWorx, Dollar Universe and Sysload Community

Expand all | Collapse all

How do you pass node varibles to a vbscript?

  • 1.  How do you pass node varibles to a vbscript?

    Posted 04-11-2018 07:12 AM
    I am running a vbscript by using the cscript shell in DU.
    I cannot figure out how to read/refer to node variables (that you define in node settings) in the vbscript.
    for command line you use %var1%, for powershell I use ${env:var1} but I cannot get the node variable into the vbscript.
    Any ideas of the syntax?



  • 2.  Re: How do you pass node varibles to a vbscript?

    Posted 07-31-2018 05:01 AM

    Hello!

    You should try this:

     

    The ExpandEnvironmentStrings method can expand environment variables embedded in a string too:

    Set wshShell = CreateObject( "WScript.Shell" )
    WScript.Echo wshShell.ExpandEnvironmentStrings( "PATH=%PATH%" )
    wshShell = Nothing

    The output will look like this (but probably longer):

    PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem