Click here to Skip to main content
15,861,125 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi frnds,
i m using following script to install software to remote pc.
VB
strUser = ""
strPassword = ""
strMSI = ""
strComputer = ""

'Get user name, cannot be blank
Do While strUser = ""
strUser = InputBox("Enter user name", "User Name")
Loop
'Get password, cannot be blank
Do While strPassword = ""
strPassword = InputBox("Enter password", "Password")
Loop
'Get msi package path, cannot be blank
Do While strMSI = ""
strMSI = InputBox("Enter the path to the msi package", "MSI package")
Loop
'Get destination computer, cannot be blank
Do While strComputer = ""
strComputer = InputBox("Enter the destination computer name", "Computer")
Loop


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)


JavaScript



CSS
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
Posted

1 solution

Here, this should help in finding out the issue: Troubleshooting "The RPC server is unavailable"[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900