本机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
)
|