Go Back   TechArena Community > Technical Support > Computer Help > Windows Server > Windows Server Help
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Sponsored Links

Running an MSI file on a remote machine

Windows Server Help

Thread Tools Search this Thread
Old 20-06-2006
Posts: n/a
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:


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

Any help would be greatly appriciated!

Reply With Quote
Old 21-06-2006
Umesh Thakur
Posts: n/a
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:
Reply With Quote
Old 21-06-2006
Posts: n/a
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

Keep in mind I'm very new and very green yet at scripting.
Reply With Quote
Old 22-06-2006
Umesh Thakur
Posts: n/a
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
Reply With Quote
Old 24-06-2006
Posts: n/a
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.
Reply With Quote
Old 26-06-2006
Posts: n/a
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.
Reply With Quote
Old 09-07-2010
Posts: n/a
Re: Running an MSI file on a remote machine

You can check this tool
Reply With Quote

  TechArena Community > Technical Support > Computer Help > Windows Server > Windows Server Help
Tags: , , , ,

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

All times are GMT +5.5. The time now is 10:02 PM.