strUser = ""
strPassword = ""
strMSI = ""
strComputer = ""
'Get user name, cannot be blank
Do While strUser = ""
strUser = InputBox("Enter user name", "User Name")
'Get password, cannot be blank
Do While strPassword = ""
strPassword = InputBox("Enter password", "Password")
'Get msi package path, cannot be blank
Do While strMSI = ""
strMSI = InputBox("Enter the path to the msi package", "MSI package")
'Get destination computer, cannot be blank
Do While strComputer = ""
strComputer = InputBox("Enter the destination computer name", "Computer")
Const wbemImpersonationLevelDelegate = 4
Set objWbemLocator = CreateObject("WbemScripting.SWbemLocator")
Set objConnection = objwbemLocator.ConnectServer _
(strComputer, "root\cimv2", strUser, strPassword)
objConnection.Security_.ImpersonationLevel = wbemImpersonationLevelDelegate
Set objSoftware = objConnection.Get("Win32_Product")
errReturn = objSoftware.Install(strMSI,,True)
but it show the following error on command prompt
SWbemLocator: The RPC server is unvalable.
pls help me what is the problem in my script
This action is not allowed at this time as the site is in read-only mode. Please try again later.
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)