VBscript - Enter a value (variable windows) on the path of downloading the installation file

Hello All,
My name is Diego and i need so much help with this VBscript,
The script works well but I just need to call (SRV) windows System variable
that contains the name of the local server.
All client machines (winxp) already have a system variable name (SRV) with
value (name of local server)for example SRVADS001, because in our environment
we have many offices with low-speed links, so need to get the download installation  file on the local serverr, so we avoid bandwidth consumption.
How i can Call SRV Variable and puts it on path
FULL_INSTALL_PATH = (INSTALL_PATH & STR_PARAMETERS) ?
I need that the installation path of the file is correct to all offices, each office has a local server defined on Windows XP variable System :
INSTALL_PATH = Chr (34) & "\\SRV (Variable)\Agent\AgInstall.exe" & Chr (34)
FY = The SRV variable just contains the name of local server, do not contain \\
VBscript
' Variable Declarations
'==================================
Dim ipAddress, agentVersion, dataPath, xmlDoc, ElemList, regExist
Dim REQUIRED_AGENT_VERSION
Dim REQUIRED_SERVER_IP
Dim INSTALL_PATH
Dim STR_PARAMETERS
Dim FULL_INSTALL_PATH
'======================================
' MUST CHANGE VARIABLES IN THIS SECTION
'======================================
REQUIRED_AGENT_VERSION="4.6.0"
REQUIRED_SERVER_IP="192.168.1.100:12300"
INSTALL_PATH = Chr(34) & "\\Server\NETLOGON\AgInstall.exe" & Chr(34)
STR_PARAMETERS = " /FORCEINSTALL /INSTALL=AGENT /INSTDIR=" & Chr(34) &
"%PROGRAMFILES%\Framework\" & Chr(34) & " /SILENT"
FULL_INSTALL_PATH = (INSTALL_PATH & STR_PARAMETERS)
'======================================
' END CHANGE VARIABLES SECTION
'======================================
Const HKEY_LOCAL_MACHINE = &H80000002
CheckRegExist()
If (regExist=TRUE) Then
'==================================
' Get Registry Values
'==================================
agentVersion = ReadReg("HKEY_LOCAL_MACHINE\SOFTWARE\Network\Framework\Data
Path")
'WScript.Echo "Agent Version: " & agentVersion
dataPath = ReadReg("HKEY_LOCAL_MACHINE\SOFTWARE\Network\Framework\Data Path")
'WScript.Echo "Data Path: " & dataPath
'==================================
' Read XML Sitelist
'==================================
Set xmlDoc = CreateObject("Msxml2.DOMDocument")
xmlDoc.load(dataPath & "\SiteList.xml")
Set ElemList = xmlDoc.getElementsByTagName("SpipeSite")
ipAddress = ElemList.item(0).getAttribute("ServerIP")
' MsgBox ipAddress & " " & InStr(REQUIRED_SERVER_IP,ipAddress)
'==================================
' Check Agent Version, ServerIP
'==================================
IF (agentVersion<REQUIRED_AGENT_VERSION) OR InStr
(REQUIRED_SERVER_IP,ipAddress) < 1 THEN
InstallNewAgent(FULL_INSTALL_PATH)
'MsgBox("Your agent is now up to date and configured correctly.")
ELSE
'MsgBox("Your agent is currently up to date and configured correctly.")
END IF
'Install Agent if Reg Does NOT exist
ELSE
InstallNewAgent(FULL_INSTALL_PATH)
END IF
'==================================
' Registry Reader
'==================================
Function ReadReg(RegPath)
Dim objRegistry, Key
Set objRegistry = CreateObject("Wscript.shell")
Key = objRegistry.RegRead(RegPath)
ReadReg = Key
End Function
'==================================
' Agent Installation
'==================================
Function InstallNewAgent(FULL_INSTALL_PATH)
Dim wshShell
Set wshShell = WScript.CreateObject ("WSCript.shell")
' MsgBox("Installing New Agent...")
wshshell.run FULL_INSTALL_PATH, 6, True
set wshshell = nothing
End Function
'==================================
' Check if Reg Key Exists
'==================================
Function CheckRegExist ()
Dim strComputer, objRegistry, strKeyPath, strValueName, strValue
strComputer = "."
Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root
\default:StdRegProv")
strKeyPath = "SOFTWARE\Network\Shared Components\Framework"
strValueName = "Version"
objRegistry.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
If IsNull(strValue) Then
'Wscript.Echo "The registry key does not exist."
regExist=FALSE
Else
'Wscript.Echo "The registry key exists. (" & strValue & ")"
regExist=TRUE
End If
End Function

If you want to use run with a variable then this is how:
 wshshell.run 
"cmd /c \\%SRV%\Share\AgInstall.exe"
By running a command under CMD you can get the env variable converted.  By itself
it won't convert.
The Chr(34) are not needed here.
Converting in VBScript As I posted is better usually:
var = Shell.Environment("process")("SRV")
wshshell.run  "\\" & var & "\Share\AgInstall.exe"
¯\_(ツ)_/¯

Similar Messages

  • Is the installation file for adobe reader, the same for all the versions of windows ? Is it ?

    Hello,
    I want to know if the installation file for adobe reader is it the same for all the windows ?
    It is because I have to do an automatic installation for XP, seven and windows 8...
    It is also the same between 32bits and 64bits ?
    Thanks.
    Best regards
    Sofia Luna

    It may be worth mentioning two things.
    1. Adobe provide extensive information on Enterprise Deployment of Acrobat and Adobe Reader.
    2. You may well need a redistribution license to do this, if you are installing on behalf of anyone (accepting EULA for them), pushing, or hosting etc.

  • 2012 I purchased CS6 Design & Web premium for students for WINDOWS. Now I want to buy a macbook. Can I download the installation files for MAC OS X with my licensed serial number for free?

    2012 I purchased CS6 Design & Web premium for students for WINDOWS. Now I want to buy a macbook. Can I download the installation files for MAC OS X with my licensed serial number for free?

    Hi There,
    We would like to inform you that you have got the serial number for Mac, it would not work on Mac machine as it is OS specific.
    If you wish you use a mac machine that you can swap the platform please refer the below mentioned link.
    Link: Order product | Platform, language swap.
    Contact support via : Contact Customer Care
    Thanks,
    Atul Saini

  • Windows 8.1 will not download iTunes setup file

    Windows 8.1 will not download iTunes setup file. It asks if I want to save the file. I click yes but it doesn't download. Tried numerous times on my new Toshiba Qosmio computer.

    See the Further Information area of Troubleshooting issues with iTunes for Windows updates for download advice and direct links if required.
    tt2

  • Where is the installer files for Acrobat 9 Pro Extended EN,FR

    New computer, I lost my CD but have my key recorded. Where can I get the installer files for "Adobe Acrobat Pro Extened - English, Francais"???

    Hi Jesse ,
    Try this once and see it it helps .
    Go to the web page : http://www.adobe.com/cfusion/tdrc/index.cfm?product=acrobat_pro&loc=en
    Login with your Adobe ID and Password. Now instead of clicking on the download button copy and paste the following link on the address bar and hit enter : http://trials2.adobe.com/Applications/Acrobat/APRO/9/trials/AcroPro90_efg.exe
    This is the direct download link for Acrobat 9.
    This link would only work from the downloads page of Acrobat 10.
    Regards
    Sukrit Dhingra

  • Problem with the installation file

    Hello Everyone!
    I am trying to install Nokia Ovi Suite in my Windows 7 computer from yesterday, whenever I run the web installer file I am getting the Error Message as "Problem with the installation file" (attached as a jpeg file with this post).
    I have downloaded the exe file (approx 88.4MB from : http://nds1.nokia.com/files/support/global/phones/software/Nokia_Ovi_Suite_webinstaller_ALL.exe ) several times, still no luck.
    Anyone is having the solution for this problem?
    Thanks in advance!
    Solved!
    Go to Solution.
    Attachments:
    Error Message.JPG ‏23 KB

    Hi SSA
    I've downloaded it so many times I nearly exceeded my download limit ! Seriously , I know others must be able to get it , so why is there a problem ?  I'm going to stop at the store where I purchased the phone and get THEM to try. If the sig is OK , I'm going to copy it and bring it home , if it's NOT OK then maybe they'll take it up with Nokia as they're the ones selling it to the ' happy customers' ..? When I first contacted support , they said to disable both firewall and A/V before attempting to download it ? I've downloaded thousands of files and never had to do that ? Sure ,you might have to disable something during installation , but not for the download ? I even did it in safe mode with networking and the same thing happened. I even asked if they could send me an install CD and they said NO.  Not happy about that either..We'll see what happens.. I like the phone ..I'd just like it to do what I bought it for !!

  • Trying to update, but im missing the installation file ITUNES.MSI

    trying to update, but im missing the installation file ITUNES.MSI

    (1) Download the Windows Installer CleanUp utility installer file (msicuu2.exe) from the following Major Geeks page (use one of the links under the "DOWNLOAD LOCATIONS" thingy on the Major Geeks page):
    http://majorgeeks.com/download.php?det=4459
    (2) Doubleclick the msicuu2.exe file and follow the prompts to install the Windows Installer CleanUp utility. (If you're on a Windows Vista or Windows 7 system and you get a Code 800A0046 error message when doubleclicking the msicuu2.exe file, try instead right-clicking on the msicuu2.exe file and selecting "Run as administrator".)
    (3) In your Start menu click All Programs and then click Windows Install Clean Up. The Windows Installer CleanUp utility window appears, listing software that is currently installed on your computer.
    (4) In the list of programs that appears in CleanUp, select any iTunes entries and click "Remove", as per the following screenshot:
    (5) Quit out of CleanUp, restart the PC and try another iTunes install. Does it go through properly this time?

  • I downloaded the installation files to my Program Files directory

    Question:   I downloaded  the exe files of my newly purchased Adobe Photoshop Elments 12 software onto my PC (Windows 7) into the program directory, but cannot get the software to initialize. I also ran the largest initialzation file, one of many in the   new AE 12  directory .  I had uninstalled two older trial versions before buying this one.

    move the installation file to your desktop and install it from there.

  • Why won't the installation file load up?

    I have downloaded the installation file and when I open it the installation window doesn't open but it is listed in the Task Manager but it isn't running. I have done everything in the trouble shooting guides and even the tutorial video and I am still having the same exact problem every time. I have done this over and over again.What is wrong and how do I fix this. This is really important to me as I need Flash Player to be able to view video for school.

    1. Restart your computer - that will make sure you do not have any Adobe installation process running.
    2. Click on the following Adobe link. Go to the bottom where it says "Still having problems". Then click on the link to install  Flash Player for Firefox.
    Installation problems | Flash Player | Windows
    I hope this solves your problem.

  • I lost the installation disks for CS4 master collection. Where can I download the installation file?

    Hello,
    I lost the installation disks for CS4 master collection polish version. Where can I download the installation file?

    Hi filmowka,
    Welcome to the Community!
    Go to http://prodesigntools.com/download-adobe-cs4-and-cs3-free-trials-here.html and choose Master collection CS4 from the list.
    Follow the Very Important Section else the download will not start.
    Thanks!
    Ankit

  • When i try downloading adobe pro i am getting an error message that is saying: The application could not be installed because the installer file is damaged. Try obtaining a new installer file from the application author.

    when i try downloading adobe pro i am getting an error message that is saying: The application could not be installed because the installer file is damaged. Try obtaining a new installer file from the application author.

    Hi Kashmore,
    Seems like the downloaded file was corrupt that could be because of either network restriction or the anti virus might have blocked it. My suggestion would be to try and download the product either by turning off the Antivirus or try a different network.
    Cheers,
    Kartikay Sharma

  • Trying to download the free trial of Adobe Acrobat XL Pro.  I keep getting the message "The application could not be installed because the installer file is damaged. Try obtaining a new installer file from the application author."  I've repeatedly tried g

    Trying to download the free trial of Adobe Acrobat XL Pro.  I keep getting the message "The application could not be installed because the installer file is damaged. Try obtaining a new installer file from the application author."  I've repeatedly tried getting a new installer file, but get the same message every time.

    K_don52 and Ande8135 please remove your current installation of the Adobe Download Assistant and reinstall.  You can find more details in the known issues section of Troubleshoot Adobe Download Assistant.

  • Adobe Air I get this message: The application could not be installed because the installer file is damaged....

    Every time I try to install new product through adobe air I get this message: The application could not be installed because the installer file is damaged. Try obtaining a new installer file from the application author. Kiran Kumar: May I have the product name and version you are referring to? I've looked over the online suggested repair which indicates to search for and delete Adobe Muse but when go looking for it, it doesn't seem to exist. How can I get this resolved?

    Finally found a fix on my own....Wasted like 3 hours today. Hope this helps for anyone struggling with that stupid error message:

  • Need the installer files for Elements 2.0

    Hey,
    Could anyone help me out and point me in the direction where I can download the installer files for Elements 2.0?
    I work at a Computer shop and have a client that wants us to reinstall her Elements 2.0 and I cannot find the installer anywhere on this site.
    I also contacted adobe support and they said they cannot help me and I need to go to the forums to find the installer.
    Any help would be appreciated.
    Thanks everyone!

    Unfortunately, adobe doesn't have installers available publicly for software that old.
    Even if you do find an installer somewhere on the internet for pse 2, it's most likely an 30 day trial version which can not be converted to a licensed version.
    You might try finding a copy on Amazon.
    I guess she can't find her original photoshop elements 2 cd?

  • Just completed the redemption process.  Where's the download and installation files?

    Just completed the redemption process.  Where's the download and installation files?

    Go to App Store > Purchases to check the OS X download progress. The installer is stored in Applications folder

Maybe you are looking for

  • Too many bugs to isolate a bug when swithching from Alt-F1 to Alt-F7

    First, I consider Linux to be the less buggy OS out there. Well, Windows would be less buggy, but it does not really exist, since you have to pay to use it. Still, I use to consider Linux very buggy. This opinion I hold true more than ever. Here is m

  • PC doesn't read cd's, but dvd's works.

    Hello, my pc is HP Pavilion dv6-2007so, about two years old. It have Windows 7, 64 bit. Cd/dvd-drive worked great until about a week ago it started to work badly. I listened some Dido cd when the cd started suddenly to twitch so i skipped few songs t

  • Has FM 9 or 10 a better working dictionary for non-english languages?

    I am using FM 7 (latest update) on Windows Vista. As it is now, there's a limit of how many characters a word can have for it to be entered into the dictionary. We here in Sweden have 3 letters that are not present in the English language, å, ä and ö

  • HTTPS sender adapter testing

    Hi All, I need to test a HTTPS (HTTP adapter) -> IDOC scenario. Can you please give some guidance on how this can be done? Can the SOAP UI tool be used for this? Where do I place the client certificates?

  • Inbound Processing With BDC

    Hi!    Can any one tell me why there is a need to go for BDC in Inbound IDOC Processing.    We can directly take the data from Fun Module & update the database why there is need for BDC.   Thanks    Rahul