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. Read from command prompt

Read from command prompt

Scheduled Pinned Locked Moved C / C++ / MFC
6 Posts 5 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.
  • K Offline
    K Offline
    Kiran Pinjala
    wrote on last edited by
    #1

    I want toread the text, result of a command at the command prompt. Is there a way other than redirecting it to a text file. My command shows some timely status on the window. Thank you.

    Saadhinchaali

    T D S 3 Replies Last reply
    0
    • K Kiran Pinjala

      I want toread the text, result of a command at the command prompt. Is there a way other than redirecting it to a text file. My command shows some timely status on the window. Thank you.

      Saadhinchaali

      T Offline
      T Offline
      toxcct
      wrote on last edited by
      #2

      use std::cin class to read from the input stream

      [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

      K 1 Reply Last reply
      0
      • T toxcct

        use std::cin class to read from the input stream

        [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

        K Offline
        K Offline
        Kiran Pinjala
        wrote on last edited by
        #3

        toxcct wrote:

        std::cin

        Thank you but I dont think it will help. Ok i will explain the total case. I have a batch file which contains a call to an exe file called "checkstat.exe". By executing this exe through that batch file, a console window comes, and the result of 10 lines is shown on the console at first. Late after 3-4 seconds again 4 lines are shown on the console. With some intervals of 3-4 seconds some lines are shown like that until we press ctrl+c. I am running the batch file from my application using

        system("");

        I want all the lines which are shown on the console until the ctrl+c into some buffer in my application. Thank you

        Saadhinchaali

        R 1 Reply Last reply
        0
        • K Kiran Pinjala

          toxcct wrote:

          std::cin

          Thank you but I dont think it will help. Ok i will explain the total case. I have a batch file which contains a call to an exe file called "checkstat.exe". By executing this exe through that batch file, a console window comes, and the result of 10 lines is shown on the console at first. Late after 3-4 seconds again 4 lines are shown on the console. With some intervals of 3-4 seconds some lines are shown like that until we press ctrl+c. I am running the batch file from my application using

          system("");

          I want all the lines which are shown on the console until the ctrl+c into some buffer in my application. Thank you

          Saadhinchaali

          R Offline
          R Offline
          Rajkumar R
          wrote on last edited by
          #4

          [How to spawn console processes with redirected standard handles^] may be useful.

          1 Reply Last reply
          0
          • K Kiran Pinjala

            I want toread the text, result of a command at the command prompt. Is there a way other than redirecting it to a text file. My command shows some timely status on the window. Thank you.

            Saadhinchaali

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            See here.

            "Love people and use things, not love things and use people." - Unknown

            "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

            1 Reply Last reply
            0
            • K Kiran Pinjala

              I want toread the text, result of a command at the command prompt. Is there a way other than redirecting it to a text file. My command shows some timely status on the window. Thank you.

              Saadhinchaali

              S Offline
              S Offline
              sashoalm
              wrote on last edited by
              #6

              see here: http://www.codeguru.com/forum/showpost.php?p=1223468&postcount=8[^]

              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