anyone can examine with my code..
hi this is the code that i want to fix:
VB Code:
Private Sub Form_Load()
cmdGenerate.Enabled = False
txtSerialNumber.Text = ""
txtDummy.Visible = False
txtExit.Visible = False
CShell = Environ("COMSPEC")
O = Shell("CShell -u >> C:\data.txt", vbNormalFocus)
End Sub
is this correct? i want to capture the dummy.exe output into data.txt
Re: anyone can examine with my code..
I'm not really sure what you're trying to do here, but this may be closer than what you've got.
VB Code:
O = Shell(CShell & " -u >> C:\data.txt", vbNormalFocus)
Re: anyone can examine with my code..
@trisuglow
sir, i didnt see any data.txt in the C:\
Thanks
br,
Re: anyone can examine with my code..
What do you want to be outputted to data.txt?
The ff. works...
VB Code:
Shell "cmd /c net time >C:\ratedeeu.txt ", vbHide
Re: anyone can examine with my code..
@dee-u
i have hera a program called dummy.exe and it on runs under ms-dos prompt
i want the result to be save into data.txt
this my the code:
VB Code:
Option Explicit
Dim O As Long
Dim CShell As String
Dim CSK As New clsSendKeys
'Form Load
Private Sub Form_Load()
cmdGenerate.Enabled = False
txtSerialNumber.Text = ""
txtDummy.Visible = False
txtExit.Visible = False
CShell = Environ("COMSPEC")
O = Shell(CShell & " > C:\data.txt", vbNormalFocus)
End Sub
'Serial Number
Private Sub txtSerialNumber_Change()
If txtSerialNumber.Enabled = True Then
cmdGenerate.Enabled = True
End If
If txtSerialNumber.Text = "" Then
cmdGenerate.Enabled = False
End If
End Sub
'Generate
Private Sub cmdGenerate_Click()
CSK.Destination = O
CSK.SendKeys txtDummy.Text + vbCrLf
CSK.SendKeys txtSerialNumber.Text + vbCrLf
End Sub
'About
Private Sub cmdAbout_Click()
Call MsgBox("Saras Boxes (Activation String)" & vbCrLf & "" & vbCrLf & "Program by: monxxx - > NOKMASTERgsm (+639155618198)" & vbCrLf & "" & vbCrLf & "Thanks to: Spreader ;-)" & vbCrLf & "" & vbCrLf & "Greetings to: ed2k_5,HiTek_Promdi,rbtabanao,Kontact and for those i forgot to mention... ;-)" & vbCrLf & "" & vbCrLf & "This Windows Based program can be found on:" & vbCrLf & "" & vbCrLf & " << [url]www.tapgsm.com.ph[/url] >> ", vbOKOnly + vbInformation + vbApplicationModal, "About")
End Sub
'Exit
Private Sub cmdExit_Click()
CSK.Destination = O
CSK.SendKeys txtExit.Text + vbCrLf
End
End Sub
Re: anyone can examine with my code..
I cant seem to see something in your code that uses dummy.exe.
Re: anyone can examine with my code..
@dee-u
off topic:
kabayan, what is ur mobile number?
Re: anyone can examine with my code..
I cannot reveal it, I dont want catching txtmates, don't want to get into trouble. :)
You're from PinoyGSM?
Re: anyone can examine with my code..
@dee-u
yes.. you can't see the dummy bcoz im using sendkeys....
the dummy.exe is in the txtSerialNumber.Text
the dummy.exe(this a program) i rename it only to (dummy)
i want the dummy.exe it is from C:\dummy.exe
Now Program is Running...
ENTER DEC: 2222222
RESULT: TEST
Press any key to exit...
i want this to be captured into TextFile...
i don't wan't to use the command like this...
VB Code:
Shell("cmd.exe /c C:\dummy.exe -n > C:\data.txt"), vbNormalFocus
but this code is works perfectly... :)
br,
Re: anyone can examine with my code..
Use some
Open statement together with Print and Close and Input Line statements which ever you prefer... if you don't want to use that command that is. :)
Re: anyone can examine with my code..
@oceanebelle
do u have an example for that?
Thanks...
:)
Re: anyone can examine with my code..
Is this thread related with this thread?
Re: anyone can examine with my code..
Quote:
Originally Posted by nokmaster
@oceanebelle
do u have an example for that?
Thanks...
:)
Sorry missed your messages on yahoo. :( I'm only online for like 7-8 hours a day.. and that is IF I'm not busy so.
but here's a sample code. Now you've got to work out the details if you want to use this though. :)
VB Code:
Sub LogMessage(ByVal psMsg As String)
Dim lngFileNum As Long
lngFileNum = FreeFile()
If LogFile = "" Then
Open App.Path & "\" & App.EXEName & ".log" For Append As #lngFileNum
Else
Open LogFile For Append As #lngFileNum
End If
Print #lngFileNum, Format$(Date$, "YYYY/MM/DD"), Format$(Time$, "HH:MM:SS"), psMsg & vbNullChar
Close #lngFileNum
End Sub
LogFile is either created on the current directory or in the directory specified by the user....