aLLigator

|
Posted: Wed Dec 07, 2011 20:03 Post subject: |
|
|
Помогите, пожалуйста, адаптировать данный скрипт для подключения к плагину и вывода информации не только для "C:\WINDOWS\notepad.exe", а всех файлов.
Code: | Option Explicit
Dim strFileName
Dim intByteCount
Dim objFSO
Dim objSpeechFileStream
Dim lngLength
Dim arrBuff
strFileName = "C:\WINDOWS\notepad.exe"
intByteCount = 2
Set objFSO = WScript.CreateObject("Scripting.FileSystemObject")
Set objSpeechFileStream = WScript.CreateObject("SAPI.SpFileStream")
If objFSO.FileExists(strFileName) Then
lngLength = objFSO.GetFile(strFileName).Size
With objSpeechFileStream
.Open strFileName
On Error Resume Next
.Seek lngLength - intByteCount
If Err.Number = 0 Then
On Error Goto 0
If .Read(arrBuff, intByteCount) = intByteCount Then
WScript.Echo ConvertByteArray2HexString(arrBuff)
End If
Else
On Error Goto 0
End If
.Close
End With
Else
' Nothing to output
End If
WScript.Quit 0
'=============================================================================
Function ConvertByteArray2HexString(arrByteArray)
Dim i
Dim strValue
strValue = ""
For i = 1 To LenB(arrByteArray)
strValue = strValue & Right("00" & Hex(AscB(MidB(arrByteArray, i, 1))), 2)
Next
ConvertByteArray2HexString = strValue
End Function
'============================================================================= | [/code] |
|