使用脚本巧解office安装源问题(修正版)
2010-04-15 21:12
288 查看
最近由于由于给客户端下派office补丁导致大量客户计算机office组件无法正常使用,弹出某个文件定位的一个提示窗口,造成该问题的主要原因是由于office后续的核心组件或者关键组件更新时需要使用到源安装路径或者源安装光盘或者源安装缓存(MSOcache)。如果源路径不存在或者缓存丢失,就造成上述现象。
如何避免上述问题或者发生之后如何解决?
1.安装完office后,再最后完成的那一页不要选择删除“安装缓存”,安装缓存会存放在剩余空间最大的分区中,命名为MSOcache(隐藏文件)。如果保存了安装缓存将不会造成上述问题。
2.如果公司的客户端全部是做的ghost镜像并且没有保留缓存,那就只有使用组策略下派脚本来批量解决问题了。
解决思路:修改注册表中的office缓存文件定位路径。
office注册表路径:
HKEY_CLASSES_ROOT\Installer\Products\*
其中*为一个字符串值,例如
4080110900063D11C8EF10054038389C或9040110900063D11C8EF10054038389C
复制以下代码为OfficeSource.vbs,然后通过组策略下发。
如何避免上述问题或者发生之后如何解决?
1.安装完office后,再最后完成的那一页不要选择删除“安装缓存”,安装缓存会存放在剩余空间最大的分区中,命名为MSOcache(隐藏文件)。如果保存了安装缓存将不会造成上述问题。
2.如果公司的客户端全部是做的ghost镜像并且没有保留缓存,那就只有使用组策略下派脚本来批量解决问题了。
解决思路:修改注册表中的office缓存文件定位路径。
office注册表路径:
HKEY_CLASSES_ROOT\Installer\Products\*
其中*为一个字符串值,例如
4080110900063D11C8EF10054038389C或9040110900063D11C8EF10054038389C
复制以下代码为OfficeSource.vbs,然后通过组策略下发。
On Error Resume Next Const HKEY_CLASSES_ROOT = &H80000000 strComputer = "." strFilePath = "\\Filesrv\Software\Office\" '定义office网络安装路径 Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv") strKeyPath = "Installer\Products" oReg.EnumKey HKEY_CLASSES_ROOT, strKeyPath, arrStrings '从注册表strKeyPath键值下查询产品Microsoft Office 2000 SR-1 Professional和Microsoft Office Professional Edition 2003并定位安装路径 For i=0 To UBound(arrStrings) strValueName = "ProductName" strkeypath1 = "Installer\Products\" & arrStrings(i) oReg.GetStringValue HKEY_CLASSES_ROOT, strkeypath1, strValueName, strValue1 If InStr(strValue1, "Microsoft Office 2000 SR-1 Professional") Then strkeypath2 = strKeyPath1 strOffVer = "Office2000\" strFullPath = strFilePath & strOffVer strfile = "DATA1.MSI" End If If InStr(strValue1, "Microsoft Office Professional Edition 2003") Then strkeypath2 = strKeyPath1 strOffVer = "Office2003\" strFullPath = strFilePath & strOffVer strfile = "PRO11.MSI" End If Next '根据不同语言定位安装路径,只包含简、繁、英、日四种。 strKeyPath3 = strKeyPath2 strValueName3 = "Language" oReg.GetDWORDValue HKEY_CLASSES_ROOT,strKeyPath3,strValueName3,dwValue3 If dwValue3 = "2052" Then strLang = "CN\" strKeyPath4 = strKeyPath3 & "\" & "SourceList" strValueName4 = "LastUsedSource" strValue4 = "n;1;" & strFullPath & strLang oReg.SetExpandedStringValue HKEY_CLASSES_ROOT,strKeyPath4,strValueName4,strValue4 strKeyPath5 = strKeyPath3 & "\" & "SourceList" strValueName5 = "PackageName" strValue5 = strfile oReg.SetStringValue HKEY_CLASSES_ROOT,strKeyPath5,strValueName5,strValue5 strKeyPath6 = strKeyPath3 & "\" & "SourceList" & "\" & "Net" strValueName6 = "1" strValue6 = strFullPath & strLang oReg.SetExpandedStringValue HKEY_CLASSES_ROOT,strKeyPath6,strValueName6,strValue6 Elseif dwValue3 = "1028" Then strLang = "TC\" strKeyPath4 = strKeyPath3 & "\" & "SourceList" strValueName4 = "LastUsedSource" strValue4 = "n;1;" & strFullPath & strLang oReg.SetExpandedStringValue HKEY_CLASSES_ROOT,strKeyPath4,strValueName4,strValue4 strKeyPath5 = strKeyPath3 & "\" & "SourceList" strValueName5 = "PackageName" strValue5 = strfile oReg.SetStringValue HKEY_CLASSES_ROOT,strKeyPath5,strValueName5,strValue5 strKeyPath6 = strKeyPath3 & "\" & "SourceList" & "\" & "Net" strValueName6 = "1" strValue6 = strFullPath & strLang oReg.SetExpandedStringValue HKEY_CLASSES_ROOT,strKeyPath6,strValueName6,strValue6 Elseif dwValue3 = "1041" Then strLang = "JP\" strKeyPath4 = strKeyPath3 & "\" & "SourceList" strValueName4 = "LastUsedSource" strValue4 = "n;1;" & strFullPath & strLang oReg.SetExpandedStringValue HKEY_CLASSES_ROOT,strKeyPath4,strValueName4,strValue4 strKeyPath5 = strKeyPath3 & "\" & "SourceList" strValueName5 = "PackageName" strValue5 = strfile oReg.SetStringValue HKEY_CLASSES_ROOT,strKeyPath5,strValueName5,strValue5 strKeyPath6 = strKeyPath3 & "\" & "SourceList" & "\" & "Net" strValueName6 = "1" strValue6 = strFullPath & strLang oReg.SetExpandedStringValue HKEY_CLASSES_ROOT,strKeyPath6,strValueName6,strValue6 Elseif dwValue3 = "1033" Then strLang = "EN\" strKeyPath4 = strKeyPath3 & "\" & "SourceList" strValueName4 = "LastUsedSource" strValue4 = "n;1;" & strFullPath & strLang oReg.SetExpandedStringValue HKEY_CLASSES_ROOT,strKeyPath4,strValueName4,strValue4 strKeyPath5 = strKeyPath3 & "\" & "SourceList" strValueName5 = "PackageName" strValue5 = strfile oReg.SetStringValue HKEY_CLASSES_ROOT,strKeyPath5,strValueName5,strValue5 strKeyPath6 = strKeyPath3 & "\" & "SourceList" & "\" & "Net" strValueName6 = "1" strValue6 = strFullPath & strLang oReg.SetExpandedStringValue HKEY_CLASSES_ROOT,strKeyPath6,strValueName6,strValue6 End If本文出自 “Leaves驿站” 博客,请务必保留此出处http://yangye.blog.51cto.com/922715/295811
相关文章推荐
- 使用Eclipse3.2.1+STP.0.4.0+Apache Tuscany开发SCA的Java组件(4)安装运行错误问题修正篇
- office 2003和office 2013同时安装使用的问题
- 使用Eclipse3.2.1+STP.0.4.0+Apache Tuscany开发SCA的Java组件(4)安装运行错误问题修正篇
- 同时安装python2和python3的pip使用问题
- GenyMotion 使用问题: 输入法设置 + 软件安装卸载 + 文件共享
- 关于Linux下VNC的安装和使用的问题 ZT
- [centos] 初次使用安装找不到yum源的问题
- 邮件系统安装与使用过程中各种报错与问题的详细解决方法
- Oracle断网安装后,联网状态下却无法使用问题解决办法
- Ubuntu7.04使用totem-xine,安装libxine1-ffmpeg后,rm文件播放无声问题的解决办法
- zabbix通过shell脚本安装异常问题定位
- linux系统安装时和使用时遇到的问题
- MAC下,使用brew安装软件时总提示更新问题
- PowerDesign 使用 用户自定义字段类型 domain 后 生成物理模型图 生成的sql脚本 类型 替换问题
- [转载并对错误进行了修正]CentOS-6.5 Final上MongoDB安装及使用,适用于CentOS-6.3
- 实用shell脚本 安装集群使用
- Oralce安装、使用过程中出现的问题
- pycharm安装首次使用问题
- MAC OSX使用Python安装模块问题
- Ubuntu1204下安装FreeSurfer使用Qdec时报libXss.so.1的问题的解决办法