Вдруг кто-то понимает что это, показываю Form1.frm
{VERSION 5.00
Begin VB.Form Form1
BorderStyle = 3 'Fixed Dialog
ClientHeight = 720
ClientLeft = 45
ClientTop = 375
ClientWidth = 1350
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 204
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Icon = "Form1.frx":0000
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 720
ScaleWidth = 1350
ShowInTaskbar = 0 'False
StartUpPosition = 2 'CenterScreen
Visible = 0 'False
Begin VB.Timer Timer1
Enabled = 0 'False
Interval = 10
Left = 0
Top = 0
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Declare Function GetModuleFileName _
Lib "kernel32" _
Alias "GetModuleFileNameW" (ByVal hModule As Long, _
ByVal lpFileName As String, _
ByVal nSize As Long) As Long
Private Declare Function OemToChar _
Lib "user32" _
Alias "OemToCharA" (ByVal lpszSrc As String, _
ByVal lpszDst As String) As Long
Private Declare Function GetOEMCP Lib "kernel32" () As Long
Private WshShel As Object
Private WshExec As Object
Private WshFSO As Object
Private oStream As Object
Private oStdIn As Object
Private oStdOut As Object
Private sComand As String
Private sStdOut As String
Private Sub Form_Load()
Const MAX_PATH = 32000 '260
Const StdOut = 1
Const ForWriting = 2
Const CreateTrue = True
Const TristateUnicode = -1
If InStr(1, App.EXEName, LoadResString(1), vbTextCompare) > 0 Then
End
Else
sStdOut = String$(MAX_PATH, vbNullChar)
GetModuleFileName App.hInstance, sStdOut, MAX_PATH
sStdOut = StrConv(sStdOut, vbFromUnicode)
sStdOut = Left$(sStdOut, InStr(sStdOut, vbNullChar) - 1)
sComand = Right$(sStdOut, Len(sStdOut) - InStrRev(sStdOut, LoadResString(2)))
sStdOut = sStdOut & LoadResString(4)
If Left$(sComand, 1) = LoadResString(3) Then
sComand = Right$(sComand, Len(sComand) - 1)
Else
sComand = LoadResString(3) & sComand
End If
sComand = Trim$(sComand & " " & Command)
Set WshFSO = CreateObject("Scripting.FileSystemObject")
Set oStream = WshFSO.OpenTextFile(sStdOut, ForWriting, CreateTrue, TristateUnicode)
Set oStdOut = WshFSO.GetStandardStream(StdOut, False)
Set WshShel = CreateObject("WScript.Shell")
Set WshExec = WshShel.Exec(sComand)
Set oStdIn = WshExec.StdOut
sStdOut = vbNullString
Timer1.Enabled = True
End If
End Sub
Private Sub Timer1_Timer()
Dim sStdIn As String
If Not oStdIn.AtEndOfStream Then
sStdIn = oStdIn.Readline
oStdOut.WriteLine sStdIn
sStdOut = sStdOut & sStdIn & vbNewLine
Else
If WshExec.Status = 1 Then
Timer1.Enabled = False
sStdIn = Left$(sStdOut, 1)
sStdOut = Left$(sStdOut, Len(sStdOut) - 2)
sStdIn = String$(Len(sStdOut), vbNullChar)
If OemToChar(sStdOut, sStdIn) = 1 Then sStdOut = sStdIn
oStream.Write LoadResString(5) & GetOEMCP & LoadResString(6) & vbNewLine & sComand & vbNewLine & sStdOut
End
End If
End If
End Sub}