We help IT Professionals succeed at work.

how-to using WMIC to install an application with source files in network share?

nokyplease
nokyplease used Ask the Experts™
on
Hi Experts,

I would like to know how to use wmic to perforce remote install with the installer package on a network share?

thanks.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Meir RivkinFull stack Software Engineer

Commented:
if u have the path of the installer package in the remote machine u can use almost any script to perform the installation.
for instance:

powershell:
(Get-WMIObject -ComputerName <remote_machine> -List | Where-Object -FilterScript {$_.Name -eq "Win32_Product"}).Install(\\AppSrv\dsp\NewPackage.msi)

Open in new window

from http://powershell.com/cs/forums/p/1487/5518.aspx

vbs:
Set objService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set objSoftware = objService.Get("Win32_Product")
objSoftware.Install("<windows_package.msi>,"SMSSITECODE=ABA DISABLESITEOPT=True DISABLECACHEOPT=True" , ALL_USERS)

Open in new window

from http://sites.google.com/site/assafmiron/ServerScripts/remoteinstall

batch:
you need to copy the installer package to the remote machine first then execute psexec, check this example: http://forum.sysinternals.com/psexec-and-remote-install_topic8575.html

Author

Commented:
i am able to install the software package (eg msi or exe) if it is on the remote machine. However, if the installer is on a network share, i am not able to do so.

is there anyway i can run a command on a remote machine and tell it to go to a network share (with UNC path \\<remote server>\blah\blah\blah.xxx) and execute the installer their?

thanks.
Meir RivkinFull stack Software Engineer

Commented:
you got to copy the installer to the server first and then run the installer as u do now,  that would the trick

Author

Commented:
can i run the installer from a UNC location?

e.g, i am at client A and want to install a software to client B remotely and the software installer is in server C.

thanks.