- Back to Home »
- VB6 »
- [VB6] Mengirim Command ke CommandPrompt dan Mengambil Hasil Command
Posted by : Unknown
Sunday, 23 February 2014
Pendahuluan

Module yang diperlukan
Public Sub Send(st As String)
Open App.Path & "\sub.cmd" For Output As #1
Print #1, st & " > """ & App.Path & "\result.txt"""
Close #1
Shell App.Path & "\sub.cmd", vbHide
End Sub
Public Function Report() As String
If Dir(App.Path & "\result.txt") = "" Then Exit Function
Open App.Path & "\result.txt" For Input As #1
Report = Input(LOF(1), 1)
Close #1
End Function
Mengirim Perintah
Send "Attrib"
Mengambil Laporan
Text1.Text = Report