Wan3000 发表于 2023-12-4 02:03:58

Office 2010 2013 2016 update automation scripts 更新自动化脚本

Office 2010 2013 2016 update automation scripts 更新自动化脚本
Create a vbs file. Run it.
Once your source machine has completed capturing the updates then an explorer window will pop up and display all the MSP files that it has captured.
Copy all MSP files from %Temp%\Updates on the test computer to the Updates folder at the Office 2010 2013 2016 network installation point.
Using these MSP files, you can now create your own slipstreamed installation or add them into your Configuration Manager source location.
创建一个vbs文件。 运行它。

源计算机完成捕获更新后,将弹出一个资源管理器窗口并显示它捕获的所有文件。
将测试计算机上的%Temp%\Updates中的所有文件复制到Office2010 2013 2016网络安装点的Updates文件夹中。
使用这些文件,您无法创建自己的slipstreamed安装或将它们添加到配置管理器源位置。


OFFICE 2016 VBS
' ScriptCryptor Project Options Begin
' HasVersionInfo: No
' Companyname:
' Productname:
' Filedescription:
' Copyrights:
' Trademarks:
' Originalname:
' Comments:
' Productversion:0. 0. 0. 0
' Fileversion:0. 0. 0. 0
' Internalname:
' Appicon:
' AdministratorManifest: No
' ScriptCryptor Project Options End
Dim oMsi,oFso,oWShell
Dim Patches,SumInfo
Dim patch,record,msp
Dim qView
Dim sTargetFolder,sMessage
Const OFFICEID = "000-0000000FF1CE}"
Const PRODUCTCODE_EMPTY = ""
Const MACHINESID = ""
Const MSIINSTALLCONTEXT_MACHINE = 4
Const MSIPATCHSTATE_APPLIED = 1
Const MSIOPENDATABASEMODE_PATCHFILE = 32
Const PID_SUBJECT = 3 'Displayname
Const PID_TEMPLATES = 7 'PatchTargets
Set oMsi = CreateObject("WindowsInstaller.Installer")
Set oFso = CreateObject("Scripting.FileSystemObject")
Set oWShell = CreateObject("Wscript.Shell")
'Create the target folder
sTargetFolder = oWShell.ExpandEnvironmentStrings("C:\")&"Office2016Updates"
If Not oFso.FolderExists(sTargetFolder) Then oFso.CreateFolder sTargetFolder
sMessage = "Patches are being copied to the C:\Office2016Updates folder." & vbCrLf & "A Windows Explorer window will open after the script has completed."
oWShell.Popup sMessage,20,"Office Updates Capture"
'Get all applied patches
Set Patches = oMsi.PatchesEx(PRODUCTCODE_EMPTY,MACHINESID,MSIINSTALLCONTEXT_MACHINE,MSIPATCHSTATE_APPLIED)
On Error Resume Next
'Enum the patches
For Each patch in Patches
   If Not Err = 0 Then Err.Clear
    'Connect to the patch file
    Set msp = oMsi.OpenDatabase(patch.PatchProperty("LocalPackage"),MSIOPENDATABASEMODE_PATCHFILE)
    Set SumInfo = msp.SummaryInformation
    If Err = 0 Then
      If InStr(SumInfo.Property(PID_TEMPLATES),OFFICEID)>0 Then
            'Get the original patch name
            Set qView = msp.OpenView("SELECT `Property`,`Value` FROM MsiPatchMetadata WHERE `Property`='StdPackageName'")
            qView.Execute : Set record = qView.Fetch()
            'Copy and rename the patch to the original file name
            oFso.CopyFile patch.PatchProperty("LocalPackage"),sTargetFolder&"\"&record.StringData(2),TRUE
      End If
    End If 'Err = 0
Next 'patch
oWShell.Run "explorer /e,"&chr(34)&sTargetFolder&chr(34)OFFICE 2013 VBS
' ScriptCryptor Project Options Begin
' HasVersionInfo: No
' Companyname:
' Productname:
' Filedescription:
' Copyrights:
' Trademarks:
' Originalname:
' Comments:
' Productversion:0. 0. 0. 0
' Fileversion:0. 0. 0. 0
' Internalname:
' Appicon:
' AdministratorManifest: No
' ScriptCryptor Project Options End
Dim oMsi,oFso,oWShell
Dim Patches,SumInfo
Dim patch,record,msp
Dim qView
Dim sTargetFolder,sMessage
Const OFFICEID = "000-0000000FF1CE}"
Const PRODUCTCODE_EMPTY = ""
Const MACHINESID = ""
Const MSIINSTALLCONTEXT_MACHINE = 4
Const MSIPATCHSTATE_APPLIED = 1
Const MSIOPENDATABASEMODE_PATCHFILE = 32
Const PID_SUBJECT = 3 'Displayname
Const PID_TEMPLATES = 7 'PatchTargets
Set oMsi = CreateObject("WindowsInstaller.Installer")
Set oFso = CreateObject("Scripting.FileSystemObject")
Set oWShell = CreateObject("Wscript.Shell")
'Create the target folder
sTargetFolder = oWShell.ExpandEnvironmentStrings("C:\")&"Office2013Updates"
If Not oFso.FolderExists(sTargetFolder) Then oFso.CreateFolder sTargetFolder
sMessage = "Patches are being copied to the C:\Office2013Updates folder." & vbCrLf & "A Windows Explorer window will open after the script has completed."
oWShell.Popup sMessage,20,"Office Updates Capture"
'Get all applied patches
Set Patches = oMsi.PatchesEx(PRODUCTCODE_EMPTY,MACHINESID,MSIINSTALLCONTEXT_MACHINE,MSIPATCHSTATE_APPLIED)
On Error Resume Next
'Enum the patches
For Each patch in Patches
   If Not Err = 0 Then Err.Clear
    'Connect to the patch file
    Set msp = oMsi.OpenDatabase(patch.PatchProperty("LocalPackage"),MSIOPENDATABASEMODE_PATCHFILE)
    Set SumInfo = msp.SummaryInformation
    If Err = 0 Then
      If InStr(SumInfo.Property(PID_TEMPLATES),OFFICEID)>0 Then
            'Get the original patch name
            Set qView = msp.OpenView("SELECT `Property`,`Value` FROM MsiPatchMetadata WHERE `Property`='StdPackageName'")
            qView.Execute : Set record = qView.Fetch()
            'Copy and rename the patch to the original file name
            oFso.CopyFile patch.PatchProperty("LocalPackage"),sTargetFolder&"\"&record.StringData(2),TRUE
      End If
    End If 'Err = 0
Next 'patch
oWShell.Run "explorer /e,"&chr(34)&sTargetFolder&chr(34)
OFFICE 2010 VBS
' ScriptCryptor Project Options Begin
' HasVersionInfo: No
' Companyname:
' Productname:
' Filedescription:
' Copyrights:
' Trademarks:
' Originalname:
' Comments:
' Productversion:0. 0. 0. 0
' Fileversion:0. 0. 0. 0
' Internalname:
' Appicon:
' AdministratorManifest: No
' ScriptCryptor Project Options End
Dim oMsi,oFso,oWShell
Dim Patches,SumInfo
Dim patch,record,msp
Dim qView
Dim sTargetFolder,sMessage
Const OFFICEID = "000-0000000FF1CE}"
Const PRODUCTCODE_EMPTY = ""
Const MACHINESID = ""
Const MSIINSTALLCONTEXT_MACHINE = 4
Const MSIPATCHSTATE_APPLIED = 1
Const MSIOPENDATABASEMODE_PATCHFILE = 32
Const PID_SUBJECT = 3 'Displayname
Const PID_TEMPLATES = 7 'PatchTargets
Set oMsi = CreateObject("WindowsInstaller.Installer")
Set oFso = CreateObject("Scripting.FileSystemObject")
Set oWShell = CreateObject("Wscript.Shell")
'Create the target folder
sTargetFolder = oWShell.ExpandEnvironmentStrings("C:\")&"Office2010Updates"
If Not oFso.FolderExists(sTargetFolder) Then oFso.CreateFolder sTargetFolder
sMessage = "Patches are being copied to the C:\Office2010Updates folder." & vbCrLf & "A Windows Explorer window will open after the script has completed."
oWShell.Popup sMessage,20,"Office Updates Capture"
'Get all applied patches
Set Patches = oMsi.PatchesEx(PRODUCTCODE_EMPTY,MACHINESID,MSIINSTALLCONTEXT_MACHINE,MSIPATCHSTATE_APPLIED)
On Error Resume Next
'Enum the patches
For Each patch in Patches
   If Not Err = 0 Then Err.Clear
    'Connect to the patch file
    Set msp = oMsi.OpenDatabase(patch.PatchProperty("LocalPackage"),MSIOPENDATABASEMODE_PATCHFILE)
    Set SumInfo = msp.SummaryInformation
    If Err = 0 Then
      If InStr(SumInfo.Property(PID_TEMPLATES),OFFICEID)>0 Then
            'Get the original patch name
            Set qView = msp.OpenView("SELECT `Property`,`Value` FROM MsiPatchMetadata WHERE `Property`='StdPackageName'")
            qView.Execute : Set record = qView.Fetch()
            'Copy and rename the patch to the original file name
            oFso.CopyFile patch.PatchProperty("LocalPackage"),sTargetFolder&"\"&record.StringData(2),TRUE
      End If
    End If 'Err = 0
Next 'patch
oWShell.Run "explorer /e,"&chr(34)&sTargetFolder&chr(34)





zuoanmu 发表于 2023-12-4 12:36:42

感谢分享~~~

liu9957_2 发表于 2023-12-4 15:13:11

谢谢分享

nmghoujx 发表于 2023-12-4 16:38:15

谢谢分享!

Locotam 发表于 2023-12-6 20:21:19

thank you really usefull :D

夜星吻 发表于 2023-12-9 20:35:27

:o请问一下,,,,,这是干啥用的???自动更新软件的????

Wan3000 发表于 2023-12-9 21:50:28

cập nhật tự động hóa
NO Click-to-Run Office installation
updates automation

jiban 发表于 2023-12-10 10:40:58

谢谢分享

kirito2022 发表于 2023-12-10 10:58:21

谢谢分享
页: [1]
查看完整版本: Office 2010 2013 2016 update automation scripts 更新自动化脚本