Results 1 to 3 of 3

Thread: Command line and VB 6

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2004
    Location
    TX
    Posts
    12

    Command line and VB 6

    Hello,

    How do you run command line utilities within your VB program without
    having to actually launch command.com or cmd.exe and then store the
    result of the command that you ran in a string?

    For example you can go to your command prompt and run ipconfig and
    it will display your network info. What would be the VB code to run
    it within your program without the user having to see the MS-DOS
    window and store the results in a string?

    Also, I know how to do it by writing the command line results to txt file but I remember there was a way without doing that.

    Thanks in advance

  2. #2
    Frenzied Member Jmacp's Avatar
    Join Date
    Jul 2003
    Location
    UK
    Posts
    1,959
    It would be

    shell "cmd /k netstat -n>c:\text1.txt",vbhide

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2004
    Location
    TX
    Posts
    12
    Originally posted by Jmacp
    It would be

    shell "cmd /k netstat -n>c:\text1.txt",vbhide
    Thanks for the reply
    However I knew that method.
    I am trying to do it without having to write any info to TXT file.
    I want the program to run the cmd utility and store the info directly in a string..

    Like I said, I ve done it before so I know its possible but I have lost the code (stupid me) so I dont remember how I did it now.
    Here is the program that utilizes that code:
    http://www.webzila.com/utilities/iplookup

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