Results 1 to 2 of 2

Thread: saving shell results

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2002
    Posts
    4

    saving shell results

    how would i get vb to do a shell command then save the results into a text file? im sorry if this isnt in the right forum. thx for any help

  2. #2
    Banned Michael_Kamen's Avatar
    Join Date
    May 2001
    Location
    The Netherlands
    Posts
    1,180
    well,
    VB Code:
    1. Dim retval As Long
    2. Dim FileNum As Integer
    3. FileNum = FreeFile
    4. retval = Shell("Notepad")
    5.  
    6. Open App.Path & "\MyText.txt" For Append As #FileNum
    7. Print #FileNum, retval
    8. Close #FileNum

    This writes the return value of the shell command to a textfile.
    Is this what you want?

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