Total Commander Forum Index Total Commander
Форум поддержки пользователей Total Commander
Сайты: Все о Total Commander | Totalcmd.net | Ghisler.com | RU.TCKB
 
 RulesRules   SearchSearch   FAQFAQ   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Single Post  Topic: Script Content Plugin 
Author Message
aLLigator



PostPosted: Wed Dec 07, 2011 20:03    Post subject: Reply with quote

Помогите, пожалуйста, адаптировать данный скрипт для подключения к плагину и вывода информации не только для "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]
View user's profile Send private message


Powered by phpBB © 2001, 2005 phpBB Group