Results 1 to 13 of 13

Thread: anyone can examine with my code..

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2002
    Location
    Philippines
    Posts
    877

    anyone can examine with my code..

    hi this is the code that i want to fix:

    VB Code:
    1. Private Sub Form_Load()
    2. cmdGenerate.Enabled = False
    3. txtSerialNumber.Text = ""
    4. txtDummy.Visible = False
    5. txtExit.Visible = False
    6. CShell = Environ("COMSPEC")
    7. O = Shell("CShell -u >> C:\data.txt", vbNormalFocus)
    8. End Sub

    is this correct? i want to capture the dummy.exe output into data.txt

  2. #2
    Frenzied Member trisuglow's Avatar
    Join Date
    Jan 2002
    Location
    Horsham, Sussex, UK
    Posts
    1,536

    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:
    1. O = Shell(CShell & " -u >> C:\data.txt", vbNormalFocus)
    This world is not my home. I'm just passing through.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2002
    Location
    Philippines
    Posts
    877

    Re: anyone can examine with my code..

    @trisuglow

    sir, i didnt see any data.txt in the C:\

    Thanks

    br,

  4. #4
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: anyone can examine with my code..

    What do you want to be outputted to data.txt?

    The ff. works...

    VB Code:
    1. Shell "cmd /c net time >C:\ratedeeu.txt ", vbHide
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2002
    Location
    Philippines
    Posts
    877

    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:
    1. Option Explicit
    2.  
    3. Dim O As Long
    4. Dim CShell As String
    5. Dim CSK As New clsSendKeys
    6.  
    7. 'Form Load
    8. Private Sub Form_Load()
    9. cmdGenerate.Enabled = False
    10. txtSerialNumber.Text = ""
    11. txtDummy.Visible = False
    12. txtExit.Visible = False
    13. CShell = Environ("COMSPEC")
    14. O = Shell(CShell & " > C:\data.txt", vbNormalFocus)
    15. End Sub
    16.  
    17. 'Serial Number
    18. Private Sub txtSerialNumber_Change()
    19. If txtSerialNumber.Enabled = True Then
    20.     cmdGenerate.Enabled = True
    21. End If
    22. If txtSerialNumber.Text = "" Then
    23. cmdGenerate.Enabled = False
    24. End If
    25. End Sub
    26.  
    27. 'Generate
    28. Private Sub cmdGenerate_Click()
    29. CSK.Destination = O
    30. CSK.SendKeys txtDummy.Text + vbCrLf
    31. CSK.SendKeys txtSerialNumber.Text + vbCrLf
    32. End Sub
    33.  
    34. 'About
    35. Private Sub cmdAbout_Click()
    36. 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")
    37. End Sub
    38.  
    39. 'Exit
    40. Private Sub cmdExit_Click()
    41. CSK.Destination = O
    42. CSK.SendKeys txtExit.Text + vbCrLf
    43. End
    44. End Sub

  6. #6
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: anyone can examine with my code..

    I cant seem to see something in your code that uses dummy.exe.
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2002
    Location
    Philippines
    Posts
    877

    Re: anyone can examine with my code..

    @dee-u

    off topic:

    kabayan, what is ur mobile number?

  8. #8
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    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?
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  9. #9

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2002
    Location
    Philippines
    Posts
    877

    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:
    1. Shell("cmd.exe /c C:\dummy.exe -n > C:\data.txt"), vbNormalFocus

    but this code is works perfectly...

    br,

  10. #10
    Frenzied Member oceanebelle's Avatar
    Join Date
    Jun 2005
    Location
    my n00k.
    Posts
    1,064

    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.

  11. #11

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2002
    Location
    Philippines
    Posts
    877

    Re: anyone can examine with my code..

    @oceanebelle

    do u have an example for that?

    Thanks...


  12. #12
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: anyone can examine with my code..

    Is this thread related with this thread?
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  13. #13
    Frenzied Member oceanebelle's Avatar
    Join Date
    Jun 2005
    Location
    my n00k.
    Posts
    1,064

    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:
    1. Sub LogMessage(ByVal psMsg As String)
    2.    
    3.     Dim lngFileNum As Long
    4.    
    5.     lngFileNum = FreeFile()
    6.     If LogFile = "" Then
    7.         Open App.Path & "\" & App.EXEName & ".log" For Append As #lngFileNum
    8.     Else
    9.         Open LogFile For Append As #lngFileNum
    10.     End If
    11.     Print #lngFileNum, Format$(Date$, "YYYY/MM/DD"), Format$(Time$, "HH:MM:SS"), psMsg & vbNullChar
    12.     Close #lngFileNum
    13.    
    14. End Sub

    LogFile is either created on the current directory or in the directory specified by the user....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width