cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted

How to call Windows environment variable in VBScript Agent installation

Hello friends,

I found this script to install mcafee agent

https://community.mcafee.com/message/50357#50357

But i need to call a System environment variable of name SRV on install path where is the framepkg.exe to install the agent because this variable contains the name of the nearest server for exemple: SRV = BRSPSVR98766, so we have no problems with network overhead.

REQUIRED_AGENT_VERSION="4.5.0.1270"

REQUIRED_SERVER_IP="10.0.2.9:10001,213.207.93.159:10001"

INSTALL_PATH = Chr(34) & "\\kuiken\netlogon\mcafee\framepkg.exe" & Chr(34)

STR_PARAMETERS = " /FORCEINSTALL /INSTALL=AGENT /INSTDIR=" & Chr(34) & "%PROGRAMFILES%\McAfee\Common Framework\" & Chr(34) & " /SILENT"

FULL_INSTALL_PATH = (INSTALL_PATH & STR_PARAMETERS)

I need the script search the local server defined on windows variable "SRV" to install  framepkg.exe.exe

I need call a windows variable SRV together  FULL_INSTALL_PATH = (INSTALL_PATH & STR_PARAMETERS) something like that:

INSTALL_PATH = Chr(34) & "\mcafee\framepkg.exe" & Chr(34)

ENV_PATH = SRV ( Here call the windows System Enviroment ) ******

STR_PARAMETERS = " /FORCEINSTALL /INSTALL=AGENT /INSTDIR=" & Chr(34) & "%PROGRAMFILES%\McAfee\Common Framework\" & Chr(34) & " /SILENT"

FULL_INSTALL_PATH = (ENV_PATH & INSTALL_PATH & STR_PARAMETERS)

SRV enviroment is pre-defined on every windows 7,xp client by image.

Anyone can help me?

Thanks so much

Message was edited by: diegobem on 3/19/14 1:41:45 PM CDT

Message was edited by: diegobem on 3/19/14 1:42:25 PM CDT
2 Replies
Highlighted

Re: How to call Windows environment variable in VBScript Agent installation

I'm not 100% sure what you're asking, but it sounds like you want to simply identify the current server name from an environment variable. Depending on where you going to declare the variables you can either create your own Wscript object or use an existing one in the code. But basically this is what you need to call an environment variable:

myobj = wscript.createobject("wscript.shell")

srv_name = myobj.expandenvironmentstrings("%COMPUTERNAME%")

 

You may want to go to VBScript forums for additional assistance.

Highlighted

Re: How to call Windows environment variable in VBScript Agent installation

Hello jenkinski Thank you for reply,

Yes, we have several offices and each office has a server, instead of downloading the frampkg.exe of the NETLOGON would like to seek this local server that is declared in the variable SRV of windows, how i can I point the path variable to \\SRV ? Could you please include these lines in the script attached? Thank you!

You Deserve an Award
Don't forget, when your helpful posts earn a kudos or get accepted as a solution you can unlock perks and badges. Those aren't the only badges, either. How many can you collect? Click here to learn more.

Community Help Hub

    New to the forums or need help finding your way around the forums? There's a whole hub of community resources to help you.

  • Find Forum FAQs
  • Learn How to Earn Badges
  • Ask for Help
Go to Community Help

Join the Community

    Thousands of customers use the McAfee Community for peer-to-peer and expert product support. Enjoy these benefits with a free membership:

  • Get helpful solutions from McAfee experts.
  • Stay connected to product conversations that matter to you.
  • Participate in product groups led by McAfee employees.
Join the Community
Join the Community