Thread: opening telnets in win2000/XP

  1. #1

    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++)
    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
    near a computer
    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
    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
    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
    It works!!

    You rock!

  6. #6
    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, 11: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, 01:16 PM