opening telnets in win2000/XP

This is a discussion on opening telnets in win2000/XP within the Windows Programming forums, part of the Platform Specific Boards category; The following runs in a loop and opens several telnet windows. The parameters and path to my telnet exe are ...

  1. #1
    Unregistered
    Guest

    opening telnets in win2000/XP

    The following runs in a loop and opens several telnet windows. The parameters and path to my telnet exe are stored in cmd.

    It works in win98, but in win2000, the loop hangs at each window until the window is closed.

    for (i=1; i<argc; i++)
    {
    etc...
    if (system(cmd)!=0)
    fprintf(stderr,"Error in system command!\n"); // let us know if there is an error
    }

    How can I get win2000 to run through the loop without stopping?

    Thanks for any help you can give!

  2. #2
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,856
    Try using a MessageBox() instead of stderr

    NULL for the HWND is the main screen

    MessageBox(NULL, "Error in system command!", "My Apps Name", MB_ICONERROR|MB_OK);


    Header: Declared in Winuser.h; include Windows.h.
    Library: Use User32.lib.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  3. #3
    Unregistered
    Guest
    Thanks, but this didn't work. I get the same behavior.

    I think the problem is in system(cmd). I will try sending win2000 some simple commands in cmd.

    Thanks again!

  4. #4
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,786
    Instead of system("Telnet......blah");


    .......try system("START Telnet......blah");

    This will open telnet in its own console and the system() will return right away......

  5. #5
    Unregistered
    Guest
    It works!!

    You rock!
    Thanks!!

  6. #6
    Unregistered
    Guest
    system(START ...) works, that is.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. opening empty file causes access violation
    By trevordunstan in forum C Programming
    Replies: 10
    Last Post: 10-21-2008, 11:19 PM
  2. opening files sequentially
    By barneygumble742 in forum C++ Programming
    Replies: 9
    Last Post: 12-21-2006, 10:26 AM
  3. need help with file opening errors
    By lld4rkll in forum C++ Programming
    Replies: 6
    Last Post: 07-13-2006, 06:20 AM
  4. Errore opening the include <windows.h>
    By rasheed in forum Windows Programming
    Replies: 5
    Last Post: 05-21-2006, 11:23 PM
  5. opening php files in IE6
    By Micko in forum Tech Board
    Replies: 7
    Last Post: 03-06-2006, 12:16 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21