Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Keep console from disappearing

Keep console from disappearing

Scheduled Pinned Locked Moved C / C++ / MFC
question
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    orcun colak
    wrote on last edited by
    #1

    I would like to popup a new dos prompt and execute tracert command when the user clicks a button. I am using WinExec for this. e.g. ::WinExec ("tracert X.X.X.X", SHOW_NORMAL); However, after tracert executes the console window disappears. How can I keep the console window from disappearing ? Thank you Orcun Colak

    P I 2 Replies Last reply
    0
    • O orcun colak

      I would like to popup a new dos prompt and execute tracert command when the user clicks a button. I am using WinExec for this. e.g. ::WinExec ("tracert X.X.X.X", SHOW_NORMAL); However, after tracert executes the console window disappears. How can I keep the console window from disappearing ? Thank you Orcun Colak

      P Offline
      P Offline
      Peak
      wrote on last edited by
      #2

      ::WinExec ("cmd.exe /c tracert X.X.X.X & pause", SW_SHOWNORMAL/* not SHOW_NORMAL ;) */); on win95/98/me I think you need to use command.com instead of cmd.exe

      1 Reply Last reply
      0
      • O orcun colak

        I would like to popup a new dos prompt and execute tracert command when the user clicks a button. I am using WinExec for this. e.g. ::WinExec ("tracert X.X.X.X", SHOW_NORMAL); However, after tracert executes the console window disappears. How can I keep the console window from disappearing ? Thank you Orcun Colak

        I Offline
        I Offline
        Ivor S Sargoytchev
        wrote on last edited by
        #3

        Use: ::WinExec("cmd /k \"tracert X.X.X.X\"", SW_SHOWNORMAL);

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups