Results 1 to 7 of 7

Thread: Running an MSI file on a remote machine

  1. #1
    brock_griffin@hotmail.com Guest

    Running an MSI file on a remote machine

    I have a script that checks remote computers for the latest update for
    a software package. If the update is not on the computer, I want the
    script to record the comptuer name to a file, and then copy a MSI file
    to the computer, then execute that MSI file in quiet mode. I'm having
    trouble because every time the script runs, it reinstalls the update on
    my local machine and not the remote machine. Pertinent part of the
    script is as follows:

    Else

    Myfile =
    "\\ServerShare\ProgramFolder\Upgraded.txt"
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set textstream = fso.OpenTextFile(myFile, 8, True)
    Textstream.WriteLine("**********************")
    Textstream.WriteLine("ComputerName: " &
    strComputer)
    Textstream.Close
    src = "\\ServerShare\ProgramFolder\File.msi"
    dest = "\\"& strComputer
    &"\C$\VViewer2003.msi"
    fso.copyfile src, dest, true
    Set objShell =
    CreateObject("WScript.Shell")
    cmd = "cmd /c psexec C:\VViewer2003.msi"
    objShell.Run cmd, 1, True

    Any help would be greatly appriciated!

  2. #2
    Umesh Thakur Guest

    RE: Running an MSI file on a remote machine

    Here is a Microsoft Article on how to install MSI packages remotely on remote
    computers. It also includes a sample example code:
    http://www.microsoft.com/technet/scr....mspx?mfr=true

  3. #3
    brock_griffin@hotmail.com Guest

    Re: Running an MSI file on a remote machine

    That helped tremendously, but for some reason, I can't get it to
    install unless someone with administrative rights is logged in. How
    can I set the impersonation level to administrative mode, or is there a
    way to supply a domain administrative username and password to do the
    install?

    Keep in mind I'm very new and very green yet at scripting.

  4. #4
    Umesh Thakur Guest

    Re: Running an MSI file on a remote machine

    Here is the script modified to run under alternate credentials...

    '------------------------------------
    strComputer = "test-pc"
    strUser = "Admin user Name"
    strPassword = "Admin password" ' you may want to read value of password
    rather than hardcoding it.

    'like, use this to read admin user's password:
    Set objPassword = CreateObject("ScriptPW.Password")
    Wscript.StdOut.Write "Please enter your password:"
    strPassword = objPassword.GetPassword()

    strDomain = "your domain"

    Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")
    Set objSWbemServices = objSWbemLocator.ConnectServer(strComputer,
    "root\cimv2", strUser, strPassword, "MS_409", "ntlmdomain:" + strDomain)

    Set objSoftware = objSWbemServices.Get("Win32_Product")
    errReturn = objSoftware.Install("c:\scripts\database.msi",,True)
    Wscript.Echo errReturn
    '-------------------------------------
    --

  5. #5
    Tim Guest

    Re: Running an MSI file on a remote machine

    Should this script work if the program to be installed is located on a
    computer other than the one where you are trying to do the install?

    I tried your script and I can only seem to get it to work when the
    program is copied to the remote PC. I am trying to install from a UNC
    path on a remote server but am getting back Error 1619.

    The article from MS says that this should be possible if you enable
    delegation which I have done, but still seem to get the same response.

  6. #6
    brock_griffin@hotmail.com Guest
    Thank you so much Umesh. You have been truely invaluable to me! This
    has been frustrating but fun at the same time, and with your help, you
    have saved me days of work!

    When running the install on remote machines, I get install error 1639.
    Is this related to log in information through the script? I can't find
    much usefull information online as of yet.

  7. #7
    mhoward Guest

    Re: Running an MSI file on a remote machine

    You can check this tool

Similar Threads

  1. Running a batch file from a remote machine in a VB code
    By Radhu in forum Software Development
    Replies: 1
    Last Post: 14-10-2011, 04:54 PM
  2. Running script on remote machine
    By SuderMan in forum Windows Server Help
    Replies: 12
    Last Post: 25-08-2010, 06:51 PM
  3. Is it possible to run any .exe in the remote machine using WMI?
    By Swati_here_2008 in forum Software Development
    Replies: 3
    Last Post: 05-05-2008, 06:45 PM
  4. WMI to remote machine
    By AndyS in forum Windows Server Help
    Replies: 3
    Last Post: 17-10-2007, 07:42 PM
  5. Execute a BAT File in a remote machine
    By Juanjillo in forum Windows Server Help
    Replies: 4
    Last Post: 23-02-2007, 01:55 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,976,373.02703 seconds with 17 queries