|
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}\\.\root\cimv2")
Set colItems = objWMIService.ExecQuery ("Select * from Win32_OperatingSystem")
For Each objItem in colItems
OSA = objItem.OSArchitecture
Next
Const HKLM = &H80000002
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}StdRegProv")
If OSA = "64-bit" Then
oReg.GetStringValue HKLM,"SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\XReplace","UninstallString",UninstallString
If Not IsNull(UninstallString) Then InstallLocation = Replace(UninstallString,"uninstall","XReplace")
Else
oReg.GetStringValue HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\XReplace","UninstallString",UninstallString
If Not IsNull(UninstallString) Then InstallLocation = Replace(UninstallString,"uninstall","XReplace")
End If
Set WshShell = WScript.CreateObject("WScript.Shell")
If IsNull(InstallLocation) Then
WshShell.Popup "杞欢鏈畨瑁咃紒", 5, "閿欒", 0
WScript.Quit
End If
Name = Array("XReplace.exe")
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate,(Debug)}\\.\root\cimv2")
Set colProcessList = objWMIService.ExecQuery ("Select * from Win32_Process")
For Each objProcess In colProcessList
For Each Process In Name
If LCase(objProcess.Name) = LCase(Process) Then
objProcess.Terminate()
End If
Next
Next
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists(InstallLocation) Then
Set ado_stream = CreateObject("ADODB.Stream")
ado_stream.Type = 1
ado_stream.open
ado_stream.LoadFromFile InstallLocation
ado_stream.position = 215133
ado_stream.Write HexToByte("E9B701000090")
ado_stream.position = 256771
ado_stream.Write HexToByte("E9CE02000090")
ado_stream.position = 277094
ado_stream.Write HexToByte("01")
ado_stream.position = 313599
ado_stream.Write HexToByte("B80100")
ado_stream.position = 313855
ado_stream.Write HexToByte("B80100")
ado_stream.position = 314442
ado_stream.Write HexToByte("B80100")
ado_stream.position = 314901
ado_stream.Write HexToByte("B80100")
ado_stream.SaveToFile InstallLocation, 2
ado_stream.Close
Set ado_stream = Nothing
End If
WshShell.Popup "瓒呯骇瀛楃涓叉壒閲忔浛鎹㈠伐鍏?v4.2.5 鐮磋В琛ヤ竵" & vbnewline & vbnewline & "鍒朵綔锛欳hiShingChan 缂栫▼璇█锛歏BScript",10,"瀹屾垚",0
Function HexToByte(hexStr)
Set xmldom = Wscript.CreateObject("Microsoft.XMLDOM")
Set byteObj= xmldom.createElement("byteObj")
byteObj.dataType = "bin.hex"
byteObj.nodeTypedValue = hexStr
HexToByte=byteObj.nodeTypedValue
End Function
这是 测试过来的结果,会把空行也处理掉,我想不出更好的办法了。我没转成ANSI所以中文乱码了。你注意下就行了 |
|