Results 1 to 7 of 7

Thread: Dos Commands

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2000
    Location
    Manchester NH
    Posts
    833
    OK I'm almost there


    open "c:\temp.bat" for output as #1
    print #1, "ping http://www.espn.com > c:\temp.txt"
    close #1

    shell "c:\temp.bat"

    ' wait for it to get done some how.

    open "c:\temp.txt" for input as #1
    b()=input lof(1),1
    close #1

    ITS Works
    But what if I want to run a command like

    NSLOOKUP
    'then send
    set type = mx
    'then
    yahoo.com

    ???
    Kurt Simons
    [I know I'm a hack but my clients don't!]

  2. #2
    Addicted Member
    Join Date
    May 2000
    Posts
    240

    Scooby Says: ARRRUUUUUUUUUUU!!!!!!????????

    Hmmmmmmpfff

    Try it like this....
    Dim message as string
    message = "NSLOOKUP set type = mx yahoo.com"
    Open "c:\temp.bat" for output as #1
    print #1, message
    close #1


    That's how i use long commands in a .bat file


    Hope it helps..
    see ya



  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2000
    Location
    Manchester NH
    Posts
    833
    Didn't work

    any other ideas?
    Kurt Simons
    [I know I'm a hack but my clients don't!]

  4. #4
    Lively Member
    Join Date
    Jul 2000
    Posts
    72

    Wink

    AFTER MUCH THOUGHT



    Here it is

    Make a file, I called it test.bat

    put in test.bat:

    set type=mx
    yahoo.com

    run:
    nslookup <test.bat
    will put output on screen

    nslookup <testbat >test.txt
    will put into file

    try that
    VB 6 Professional Edition

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2000
    Location
    Manchester NH
    Posts
    833
    I can't get it to work.
    I just want to see it work with this code
    minus the output


    Open "c:\temp.bat" For Output As #1
    Print #1, "yahoo.com"
    Close #1

    Open "c:\temp1.bat" For Output As 1
    Print #1, "nslookup >c:\temp.bat"
    Close #1


    Shell "c:\temp1.bat", vbMaximizedFocus
    Kurt Simons
    [I know I'm a hack but my clients don't!]

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2000
    Location
    Manchester NH
    Posts
    833
    NEVER MIND


    I got it!
    Kurt Simons
    [I know I'm a hack but my clients don't!]

  7. #7
    Lively Member
    Join Date
    Jul 2000
    Posts
    72
    Open "c:\temp.bat" For Output As #1
    Print #1, "yahoo.com"
    Close #1

    Open "c:\temp1.bat" For Output As 1
    Print #1, "nslookup >c:\temp.bat"
    Close #1

    Shell "c:\temp1.bat", vbMaximizedFocus
    All the above code does is place "yahoo.com" in temp.bat

    turn the arrow around in temp1.bat file. you are not passing nslookup anything to evalute you are only telling it to send output to the file temp.bat. but there is no output

    i am leaving today at noon EST. I can check my email for the next few days, so if you need more help with this after noon, send it to email.

    [email protected]


    will look a few more times before noon
    VB 6 Professional Edition

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