找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 283|回复: 9

[原创] Office 2010 2013 2016 update automation scripts 更新自动化脚本

[复制链接]

2

主题

2

回帖

188

积分

注册会员

积分
188
发表于 2023-12-4 02:03:58 | 显示全部楼层 |阅读模式
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
  1. ' ScriptCryptor Project Options Begin
  2. ' HasVersionInfo: No
  3. ' Companyname:
  4. ' Productname:
  5. ' Filedescription:
  6. ' Copyrights:
  7. ' Trademarks:
  8. ' Originalname:
  9. ' Comments:
  10. ' Productversion:  0. 0. 0. 0
  11. ' Fileversion:  0. 0. 0. 0
  12. ' Internalname:
  13. ' Appicon:
  14. ' AdministratorManifest: No
  15. ' ScriptCryptor Project Options End
  16. Dim oMsi,oFso,oWShell
  17. Dim Patches,SumInfo
  18. Dim patch,record,msp
  19. Dim qView
  20. Dim sTargetFolder,sMessage
  21. Const OFFICEID = "000-0000000FF1CE}"
  22. Const PRODUCTCODE_EMPTY = ""
  23. Const MACHINESID = ""
  24. Const MSIINSTALLCONTEXT_MACHINE = 4
  25. Const MSIPATCHSTATE_APPLIED = 1
  26. Const MSIOPENDATABASEMODE_PATCHFILE = 32
  27. Const PID_SUBJECT = 3 'Displayname
  28. Const PID_TEMPLATES = 7 'PatchTargets
  29. Set oMsi = CreateObject("WindowsInstaller.Installer")
  30. Set oFso = CreateObject("Scripting.FileSystemObject")
  31. Set oWShell = CreateObject("Wscript.Shell")
  32. 'Create the target folder
  33. sTargetFolder = oWShell.ExpandEnvironmentStrings("C:")&"Office2016Updates"
  34. If Not oFso.FolderExists(sTargetFolder) Then oFso.CreateFolder sTargetFolder
  35. sMessage = "Patches are being copied to the C:\Office2016Updates folder." & vbCrLf & "A Windows Explorer window will open after the script has completed."
  36. oWShell.Popup sMessage,20,"Office Updates Capture"
  37. 'Get all applied patches
  38. Set Patches = oMsi.PatchesEx(PRODUCTCODE_EMPTY,MACHINESID,MSIINSTALLCONTEXT_MACHINE,MSIPATCHSTATE_APPLIED)
  39. On Error Resume Next
  40. 'Enum the patches
  41. For Each patch in Patches
  42.    If Not Err = 0 Then Err.Clear
  43.     'Connect to the patch file
  44.     Set msp = oMsi.OpenDatabase(patch.PatchProperty("LocalPackage"),MSIOPENDATABASEMODE_PATCHFILE)
  45.     Set SumInfo = msp.SummaryInformation
  46.     If Err = 0 Then
  47.         If InStr(SumInfo.Property(PID_TEMPLATES),OFFICEID)>0 Then
  48.             'Get the original patch name
  49.             Set qView = msp.OpenView("SELECT `Property`,`Value` FROM MsiPatchMetadata WHERE `Property`='StdPackageName'")
  50.             qView.Execute : Set record = qView.Fetch()
  51.             'Copy and rename the patch to the original file name
  52.             oFso.CopyFile patch.PatchProperty("LocalPackage"),sTargetFolder&""&record.StringData(2),TRUE
  53.         End If
  54.     End If 'Err = 0
  55. Next 'patch
  56. oWShell.Run "explorer /e,"&chr(34)&sTargetFolder&chr(34)
复制代码
OFFICE 2013 VBS
  1. ' ScriptCryptor Project Options Begin
  2. ' HasVersionInfo: No
  3. ' Companyname:
  4. ' Productname:
  5. ' Filedescription:
  6. ' Copyrights:
  7. ' Trademarks:
  8. ' Originalname:
  9. ' Comments:
  10. ' Productversion:  0. 0. 0. 0
  11. ' Fileversion:  0. 0. 0. 0
  12. ' Internalname:
  13. ' Appicon:
  14. ' AdministratorManifest: No
  15. ' ScriptCryptor Project Options End
  16. Dim oMsi,oFso,oWShell
  17. Dim Patches,SumInfo
  18. Dim patch,record,msp
  19. Dim qView
  20. Dim sTargetFolder,sMessage
  21. Const OFFICEID = "000-0000000FF1CE}"
  22. Const PRODUCTCODE_EMPTY = ""
  23. Const MACHINESID = ""
  24. Const MSIINSTALLCONTEXT_MACHINE = 4
  25. Const MSIPATCHSTATE_APPLIED = 1
  26. Const MSIOPENDATABASEMODE_PATCHFILE = 32
  27. Const PID_SUBJECT = 3 'Displayname
  28. Const PID_TEMPLATES = 7 'PatchTargets
  29. Set oMsi = CreateObject("WindowsInstaller.Installer")
  30. Set oFso = CreateObject("Scripting.FileSystemObject")
  31. Set oWShell = CreateObject("Wscript.Shell")
  32. 'Create the target folder
  33. sTargetFolder = oWShell.ExpandEnvironmentStrings("C:")&"Office2013Updates"
  34. If Not oFso.FolderExists(sTargetFolder) Then oFso.CreateFolder sTargetFolder
  35. sMessage = "Patches are being copied to the C:\Office2013Updates folder." & vbCrLf & "A Windows Explorer window will open after the script has completed."
  36. oWShell.Popup sMessage,20,"Office Updates Capture"
  37. 'Get all applied patches
  38. Set Patches = oMsi.PatchesEx(PRODUCTCODE_EMPTY,MACHINESID,MSIINSTALLCONTEXT_MACHINE,MSIPATCHSTATE_APPLIED)
  39. On Error Resume Next
  40. 'Enum the patches
  41. For Each patch in Patches
  42.    If Not Err = 0 Then Err.Clear
  43.     'Connect to the patch file
  44.     Set msp = oMsi.OpenDatabase(patch.PatchProperty("LocalPackage"),MSIOPENDATABASEMODE_PATCHFILE)
  45.     Set SumInfo = msp.SummaryInformation
  46.     If Err = 0 Then
  47.         If InStr(SumInfo.Property(PID_TEMPLATES),OFFICEID)>0 Then
  48.             'Get the original patch name
  49.             Set qView = msp.OpenView("SELECT `Property`,`Value` FROM MsiPatchMetadata WHERE `Property`='StdPackageName'")
  50.             qView.Execute : Set record = qView.Fetch()
  51.             'Copy and rename the patch to the original file name
  52.             oFso.CopyFile patch.PatchProperty("LocalPackage"),sTargetFolder&""&record.StringData(2),TRUE
  53.         End If
  54.     End If 'Err = 0
  55. Next 'patch
  56. oWShell.Run "explorer /e,"&chr(34)&sTargetFolder&chr(34)
复制代码
OFFICE 2010 VBS
  1. ' ScriptCryptor Project Options Begin
  2. ' HasVersionInfo: No
  3. ' Companyname:
  4. ' Productname:
  5. ' Filedescription:
  6. ' Copyrights:
  7. ' Trademarks:
  8. ' Originalname:
  9. ' Comments:
  10. ' Productversion:  0. 0. 0. 0
  11. ' Fileversion:  0. 0. 0. 0
  12. ' Internalname:
  13. ' Appicon:
  14. ' AdministratorManifest: No
  15. ' ScriptCryptor Project Options End
  16. Dim oMsi,oFso,oWShell
  17. Dim Patches,SumInfo
  18. Dim patch,record,msp
  19. Dim qView
  20. Dim sTargetFolder,sMessage
  21. Const OFFICEID = "000-0000000FF1CE}"
  22. Const PRODUCTCODE_EMPTY = ""
  23. Const MACHINESID = ""
  24. Const MSIINSTALLCONTEXT_MACHINE = 4
  25. Const MSIPATCHSTATE_APPLIED = 1
  26. Const MSIOPENDATABASEMODE_PATCHFILE = 32
  27. Const PID_SUBJECT = 3 'Displayname
  28. Const PID_TEMPLATES = 7 'PatchTargets
  29. Set oMsi = CreateObject("WindowsInstaller.Installer")
  30. Set oFso = CreateObject("Scripting.FileSystemObject")
  31. Set oWShell = CreateObject("Wscript.Shell")
  32. 'Create the target folder
  33. sTargetFolder = oWShell.ExpandEnvironmentStrings("C:")&"Office2010Updates"
  34. If Not oFso.FolderExists(sTargetFolder) Then oFso.CreateFolder sTargetFolder
  35. sMessage = "Patches are being copied to the C:\Office2010Updates folder." & vbCrLf & "A Windows Explorer window will open after the script has completed."
  36. oWShell.Popup sMessage,20,"Office Updates Capture"
  37. 'Get all applied patches
  38. Set Patches = oMsi.PatchesEx(PRODUCTCODE_EMPTY,MACHINESID,MSIINSTALLCONTEXT_MACHINE,MSIPATCHSTATE_APPLIED)
  39. On Error Resume Next
  40. 'Enum the patches
  41. For Each patch in Patches
  42.    If Not Err = 0 Then Err.Clear
  43.     'Connect to the patch file
  44.     Set msp = oMsi.OpenDatabase(patch.PatchProperty("LocalPackage"),MSIOPENDATABASEMODE_PATCHFILE)
  45.     Set SumInfo = msp.SummaryInformation
  46.     If Err = 0 Then
  47.         If InStr(SumInfo.Property(PID_TEMPLATES),OFFICEID)>0 Then
  48.             'Get the original patch name
  49.             Set qView = msp.OpenView("SELECT `Property`,`Value` FROM MsiPatchMetadata WHERE `Property`='StdPackageName'")
  50.             qView.Execute : Set record = qView.Fetch()
  51.             'Copy and rename the patch to the original file name
  52.             oFso.CopyFile patch.PatchProperty("LocalPackage"),sTargetFolder&""&record.StringData(2),TRUE
  53.         End If
  54.     End If 'Err = 0
  55. Next 'patch
  56. oWShell.Run "explorer /e,"&chr(34)&sTargetFolder&chr(34)
复制代码






26

主题

3780

回帖

1万

积分

钻石会员

积分
10485
发表于 2023-12-4 12:36:42 | 显示全部楼层
感谢分享~~~
回复

使用道具 举报

5

主题

1609

回帖

3808

积分

铂金会员

积分
3808
发表于 2023-12-4 15:13:11 | 显示全部楼层
谢谢分享
回复

使用道具 举报

2

主题

891

回帖

1154

积分

黄金会员

积分
1154
发表于 2023-12-4 16:38:15 | 显示全部楼层
谢谢分享!
回复

使用道具 举报

0

主题

1

回帖

55

积分

注册会员

积分
55
发表于 2023-12-6 20:21:19 | 显示全部楼层
thank you really usefull
回复 送鲜花 仍鸡蛋

使用道具 举报

2

主题

53

回帖

263

积分

中级会员

积分
263
发表于 2023-12-9 20:35:27 | 显示全部楼层
请问一下,,,,,这是干啥用的???自动更新软件的????

点评

NO Click-to-Run Office installation updates automation  发表于 2023-12-9 21:51
回复 送鲜花 仍鸡蛋

使用道具 举报

2

主题

2

回帖

188

积分

注册会员

积分
188
 楼主| 发表于 2023-12-9 21:50:28 | 显示全部楼层
cập nhật tự động hóa
NO Click-to-Run Office installation
updates automation
回复 送鲜花 仍鸡蛋

使用道具 举报

0

主题

1477

回帖

1975

积分

黄金会员

积分
1975

VIP会员

发表于 2023-12-10 10:40:58 | 显示全部楼层
谢谢分享
回复

使用道具 举报

0

主题

1264

回帖

2250

积分

黄金会员

积分
2250
发表于 2023-12-10 10:58:21 | 显示全部楼层
谢谢分享
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|爱好网 ( 赣ICP备14007844号-1 )

GMT+8, 2024-4-29 16:04 , Processed in 0.094347 second(s), 27 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表