On Error Resume Next
Dim i
Set FSO = CreateObject("Scripting.FileSystemObject")
Set WsShell = CreateObject("WScript.Shell")
RegPathValue = "HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Word\Options\PROGRAMDIR"
Path = WsShell.RegRead(RegPathValue)	'获取 Office 12 的安装路径

Set MyFile = FSO.CreateTextFile("CopyFile.bat", True)
MyFile.WriteLine("@echo off")
MyFile.WriteLine("copy KBD*.dll ""%SystemRoot%\system32"" /y")
MyFile.WriteLine("copy *.ttf ""%SystemRoot%\Fonts"" /y")
MyFile.WriteLine("regedit /s Layout.reg")
If Path <> "" Then
	MyFile.WriteLine("copy usp10-Vista.dll """ & Path & "usp10.dll"" /y")
End If
For i = 1 to 11
	MyFile.WriteLine("IF EXIST ""%CommonProgramFiles%\Microsoft Shared\Office" & i & """ (")
	MyFile.WriteLine("	copy usp10-Vista.dll ""%CommonProgramFiles%\Microsoft Shared\Office" & i & "\usp10.dll"" /y")
	MyFile.WriteLine(")")
Next
'MyFile.WriteLine("call Replacer.cmd replace.txt")
MyFile.WriteLine("del %0")
MyFile.Close()
WsShell.Run "CopyFile.bat"
WsShell.Run "Replacer.cmd replace.txt"