标签:exec product install oba mis each pat rod from
Dim fso,wshSet wsh=WScript.CreateObject("wscript.shell")
strComputer = "."
dim version(3)
version(0) ="15.007.20033"
version(1) ="20.006.20034"
version(2) ="15.007.20033"
version(3) ="19.008.20071"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\" & strComputer & "\root\cimv2")
Set colSoftware = objWMIService.ExecQuery _
("Select * from Win32_Product")
installed = "N"
for Each soft In colSoftware
flag = "N"
Set re = New RegExp
set reChines = New RegExp
re.Pattern="Adobe Reader X|Adobe Acrobat"
reChines.Pattern = "Chinese|chinese"
if re.Test(soft.name) Then
installed = "Y"
for i = 0 to 3
if version(i) = soft.version Then
flag = "Y"
end if
Next
if flag = "N" then
soft.uninstall()
if reChines.Test(soft.name) then
wsh.Run "msiexec /i \\fileName\pdfUpdate\AcroRdrDC1900820071_zh_CN\AcroRead.msi /qb"
else
wsh.Run "msiexec /i \\fileName\pdfUpdate\AcroRdrDC2000620034\AcroRead.msi /qb"
end if
end if
End if
Next
if installed = "N" then
wsh.Run "msiexec /i \fileName\pdfUpdate\AcroRdrDC2000620034\AcroRead.msi /qb"
end if
标签:exec product install oba mis each pat rod from
原文地址:https://blog.51cto.com/14825007/2498397