码迷,mamicode.com
首页 > 其他好文 > 详细

全厂更新ADOBE软件

时间:2020-05-26 09:21:34      阅读:71      评论:0      收藏:0      [点我收藏+]

标签:exec   product   install   oba   mis   each   pat   rod   from   

Dim fso,wsh
Dim re,f

Set 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

全厂更新ADOBE软件

标签:exec   product   install   oba   mis   each   pat   rod   from   

原文地址:https://blog.51cto.com/14825007/2498397

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!