最近由于由于给客户端下派office补丁导致大量客户计算机office组件无法正常使用,弹出某个文件定位的一个提示窗口,造成该问题的主要原因是由于office后续的核心组件或者关键组件更新时需要使用到源安装路径或者源安装光盘或者源安装缓存(MSOcache)。如果源路径不存在或者缓存丢失,就造成上述现象。
如何避免上述问题或者发生之后如何解决?
1.安装完office后,再最后完成的那一页不要选择删除“安装缓存”,安装缓存会存放在剩余空间最大的分区中,命名为MSOcache(隐藏文件)。如果保存了安装缓存将不会造成上述问题。
2.如果公司的客户端全部是做的ghost镜像并且没有保留缓存,那就只有使用组策略下派脚本来批量解决问题了。
解决思路:修改注册表中的office缓存文件定位路径。
office注册表路径:
HKEY_CLASSES_ROOT\Installer\Products\*
其中*为一个字符串值,例如
4080110900063D11C8EF10054038389C或9040110900063D11C8EF10054038389C
复制以下代码为OfficeSource.vbs,然后通过组策略下发。
  1. On Error Resume Next
  2. Const HKEY_CLASSES_ROOT = &H80000000
  3. strComputer = "."
  4. strFilePath = "\\Filesrv\Software\Office\"  '定义office网络安装路径
  5. Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
  6. strKeyPath = "Installer\Products"
  7. oReg.EnumKey HKEY_CLASSES_ROOT, strKeyPath, arrStrings
  8. '从注册表strKeyPath键值下查询产品Microsoft Office 2000 SR-1 Professional和Microsoft Office Professional Edition 2003并定位安装路径
  9. For i=0 To UBound(arrStrings)
  10. strValueName = "ProductName"
  11. strkeypath1 = "Installer\Products\" & arrStrings(i)
  12. oReg.GetStringValue HKEY_CLASSES_ROOT, strkeypath1, strValueName, strValue1
  13. If InStr(strValue1, "Microsoft Office 2000 SR-1 Professional") Then
  14. strkeypath2 = strKeyPath1
  15. strOffVer = "Office2000\"
  16. strFullPath = strFilePath & strOffVer
  17. strfile = "DATA1.MSI"
  18. End If
  19. If InStr(strValue1, "Microsoft Office Professional Edition 2003") Then
  20. strkeypath2 = strKeyPath1
  21. strOffVer = "Office2003\"
  22. strFullPath = strFilePath & strOffVer
  23. strfile = "PRO11.MSI"
  24. End If
  25. Next
  26. '根据不同语言定位安装路径,只包含简、繁、英、日四种。
  27. strKeyPath3 = strKeyPath2
  28. strValueName3 = "Language"
  29. oReg.GetDWORDValue HKEY_CLASSES_ROOT,strKeyPath3,strValueName3,dwValue3
  30. If dwValue3 = "2052" Then
  31. strLang = "CN\"
  32. strKeyPath4 = strKeyPath3 & "\" & "SourceList"
  33. strValueName4 = "LastUsedSource"
  34. strValue4 = "n;1;" & strFullPath & strLang
  35. oReg.SetExpandedStringValue HKEY_CLASSES_ROOT,strKeyPath4,strValueName4,strValue4
  36. strKeyPath5 = strKeyPath3 & "\" & "SourceList"
  37. strValueName5 = "PackageName"
  38. strValue5 = strfile
  39. oReg.SetStringValue HKEY_CLASSES_ROOT,strKeyPath5,strValueName5,strValue5
  40. strKeyPath6 = strKeyPath3 & "\" & "SourceList"  & "\" & "Net"
  41. strValueName6 = "1"
  42. strValue6 = strFullPath & strLang
  43. oReg.SetExpandedStringValue HKEY_CLASSES_ROOT,strKeyPath6,strValueName6,strValue6
  44. Elseif dwValue3 = "1028" Then
  45. strLang = "TC\"
  46. strKeyPath4 = strKeyPath3 & "\" & "SourceList"
  47. strValueName4 = "LastUsedSource"
  48. strValue4 = "n;1;" & strFullPath & strLang
  49. oReg.SetExpandedStringValue HKEY_CLASSES_ROOT,strKeyPath4,strValueName4,strValue4
  50. strKeyPath5 = strKeyPath3 & "\" & "SourceList"
  51. strValueName5 = "PackageName"
  52. strValue5 = strfile
  53. oReg.SetStringValue HKEY_CLASSES_ROOT,strKeyPath5,strValueName5,strValue5
  54. strKeyPath6 = strKeyPath3 & "\" & "SourceList"  & "\" & "Net"
  55. strValueName6 = "1"
  56. strValue6 = strFullPath & strLang
  57. oReg.SetExpandedStringValue HKEY_CLASSES_ROOT,strKeyPath6,strValueName6,strValue6
  58. Elseif dwValue3 = "1041" Then
  59. strLang = "JP\"
  60. strKeyPath4 = strKeyPath3 & "\" & "SourceList"
  61. strValueName4 = "LastUsedSource"
  62. strValue4 = "n;1;" & strFullPath & strLang
  63. oReg.SetExpandedStringValue HKEY_CLASSES_ROOT,strKeyPath4,strValueName4,strValue4
  64. strKeyPath5 = strKeyPath3 & "\" & "SourceList"
  65. strValueName5 = "PackageName"
  66. strValue5 = strfile
  67. oReg.SetStringValue HKEY_CLASSES_ROOT,strKeyPath5,strValueName5,strValue5
  68. strKeyPath6 = strKeyPath3 & "\" & "SourceList"  & "\" & "Net"
  69. strValueName6 = "1"
  70. strValue6 = strFullPath & strLang
  71. oReg.SetExpandedStringValue HKEY_CLASSES_ROOT,strKeyPath6,strValueName6,strValue6
  72. Elseif dwValue3 = "1033" Then
  73. strLang = "EN\"
  74. strKeyPath4 = strKeyPath3 & "\" & "SourceList"
  75. strValueName4 = "LastUsedSource"
  76. strValue4 = "n;1;" & strFullPath & strLang
  77. oReg.SetExpandedStringValue HKEY_CLASSES_ROOT,strKeyPath4,strValueName4,strValue4
  78. strKeyPath5 = strKeyPath3 & "\" & "SourceList"
  79. strValueName5 = "PackageName"
  80. strValue5 = strfile
  81. oReg.SetStringValue HKEY_CLASSES_ROOT,strKeyPath5,strValueName5,strValue5
  82. strKeyPath6 = strKeyPath3 & "\" & "SourceList"  & "\" & "Net"
  83. strValueName6 = "1"
  84. strValue6 = strFullPath & strLang
  85. oReg.SetExpandedStringValue HKEY_CLASSES_ROOT,strKeyPath6,strValueName6,strValue6
  86. End If
本文转自yangye1985 51CTO博客,原文链接:http://blog.51cto.com/yangye/295811,如需转载请自行联系原作者

使用脚本巧解office安装源问题(修正版)相关推荐

  1. Office安装源损坏

    故障现象:安装office时,提示"Microsoft office安装程序无法继续,因为安装源错误". 解决方案: 1.从Microsoft下载中心,下载最新版本Microsof ...

  2. linux下载gitlab文件,Linux下安装Gitlab10(修正版)

    原来发表的文章地址:Linux下安装Gitlab:步骤及方式不是最好的:其中 nginx 可以整合到之前就有的Nginx中不需要更改nginx pid让系统运行两个nginx. 系统是Centos7 ...

  3. 非常运维 一体化终端安全管理系统自动安装脚本详解

    非常运维 一体化终端安全管理系统自动安装脚本详解   作者:高玉涵 时间:2019.03.13 13:52 博客:blog.csdn.net/cg_i 演示:https://v.youku.com/v ...

  4. 【SA8295P 源码分析】53 - mifs.build.tmpl 脚本详解:启动QNX procnto-smp-instr微内核、启动QNX串口终端shell、加载解析并执行ifs2_la.img

    [SA8295P 源码分析]53 - mifs.build.tmpl 脚本详解:启动QNX procnto-smp-instr微内核.启动QNX串口终端shell.加载解析并执行ifs2_la.img ...

  5. 编写shell脚本实现自动化搭建安装LNMP平台全过程配置详解

    注意:如果是输入的是字母的或者是输入等于0时,则会出现以下两种情况!!! 查看端口: 进到Nginx根目录查看创建好的测试网页: 注意:关闭防火墙或者设置防火墙规则!!! 访问Nginx网页: 访问P ...

  6. chrome linux添加图标,IT之家学院:Chromebook修改Linux容器安装源教程详解

    在Chrome OS 70稳定版通道系统中谷歌给用户们带来全新UI的同时也带来一个非常重要的特性更新--那就是Linux容器.现在原生系统的Chrome OS用户们也能够使用到Linux的部分功能. ...

  7. linux设置操作系统安装盘的iso文件为安装源安装mysql服务_Linux 操作系统安装盘的定制...

    Linux 操作系统安装盘的定制 汪伦伟 2005 年 3 月 01 日发布 1引言 通常由于某种实际应用,需要一个包含所有最近更新的RPM包的操作系统发布盘,以备在安装时一次完成所有的更新操作,或者 ...

  8. Linux如何编译安装源码包软件

    一.什么是源码包软件: 顾名思义,源码包就是源代码的可见的软件包,基于Linux和BSD系统的软件最常见:在国内源可见的软件几乎绝迹:大多开源软件都是国外出品:在国内较为出名的开源软件有fcitx;l ...

  9. Linux操作系统下如何编译安装源码包软件

    一.什么是源码包软件? 顾名思义,源码包就是源代码的可见的软件包,基于Linux和BSD系统的软件最常见:在国内源可见的软件几乎绝迹:大多开源软件都是国外出品:在国内较为出名的开源软件有fcitx;l ...

最新文章

  1. Visual Studio 2008 和 .NET 3.5 发布了
  2. springboot: ajax异步提交表单
  3. 用于显示本地通知的跨平台插件flutter_local_notifications
  4. [云炬创业管理笔记]第九章为创业成败而准备测试1
  5. com.android.dex.DexIndexOverflowException: Cannot merge new index 66299 into a non-jumbo instruction
  6. 人工智能之基于face_recognition的人脸检测与识别
  7. 我的C#/.NET学习诀窍——LINQPad
  8. 外媒:三星电子正与华为商讨芯片代工事宜
  9. 第一章 进程与线程的基本概念
  10. 根据中文字符串查询拼音声母
  11. 智能家居无线组网技术,WiFi芯片模组连接应用,物联网无线技术发展
  12. 有道词典使用离线翻译
  13. 教教大家系统之家装机大师怎么用?
  14. Excel打开csv文件乱码
  15. linux gpt分区挂载,GPT分区和挂载
  16. Android怎么实现解压文件,Android如何实现压缩和解压缩文件
  17. 基于 Robot Framework 实现网络自动化测试
  18. mapstruct使用
  19. type_traits之 析取 合取 否定
  20. Java日期 SimpleDateFormat,Calander使用

热门文章

  1. Python3,2段代码,给pdf文件添加水印,原来watermark还可以这么玩。
  2. 【ML31】Advanced K-means clustering algorithm
  3. 利用Collections.sort方法重写Comparator接口的compare方法对list集合排序
  4. SecureCRT8.5的下载、安装和注册(详细图解)
  5. 白盒测试基础知识(概念、目的、方法、工具)
  6. igraph的layout布局
  7. David Patterson 撰文:关于RISC-V的五个谬误
  8. 一个按键精灵后台发送消息的脚本
  9. 【Linux】编译的四个步骤
  10. windows11 Vmware16.2 挂起报错Workstation unrecoverable error: (vcpu-0)