MSI实现SILENT安装自动化

来源:互联网 发布:suse linux 网关 编辑:程序博客网 时间:2024/06/05 08:23

本机silent安装自动化:

1
2
3
4
5
6
'  本机机器silent安装软件
Const ALL_USERS = True
 
Set objService = GetObject("winmgmts:")
Set objSoftware = objService.Get("Win32_Product")
errReturn = objSoftware.Install("c:\iquicktest.msi", , ALL_USERS)

远程Silent安装自动化:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
' 远程silent安装软件
 
Computer = "MyPC"
user = "MyPC\administrator"
pwd = "password"
 
Const wbemImpersonationLevelDelegate = 4
 
Set objWbemLocator = CreateObject("WbemScripting.SWbemLocator")
Set objConnection = objwbemLocator.ConnectServer _
    (Computer, "root\cimv2", user, _
         pwd)
objConnection.Security_.ImpersonationLevel = wbemImpersonationLevelDelegate
 
Set objSoftware = objConnection.Get("Win32_Product")
errReturn = objSoftware.Install("\\shared\Setup\iquicktest.msi",,True)
0 0
原创粉丝点击