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. Linux Programming
  4. Running console apps on windows 7

Running console apps on windows 7

Scheduled Pinned Locked Moved Linux Programming
linuxquestion
7 Posts 5 Posters 23 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.
  • C Offline
    C Offline
    Calin Negru
    wrote on last edited by
    #1

    how do you run a console program with arguments on windows 7? when you run it from the shell the window disapears instantly.

    V L D 3 Replies Last reply
    0
    • C Calin Negru

      how do you run a console program with arguments on windows 7? when you run it from the shell the window disapears instantly.

      V Offline
      V Offline
      Victor Nijegorodov
      wrote on last edited by
      #2

      You can be[Using Pause (The GNU C Library)](https://www.gnu.org/software/libc/manual/html\_node/Using-Pause.html) before return from main().

      C 1 Reply Last reply
      0
      • C Calin Negru

        how do you run a console program with arguments on windows 7? when you run it from the shell the window disapears instantly.

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Run it in a cmd window, just like in a Linux terminal.

        C J 2 Replies Last reply
        0
        • L Lost User

          Run it in a cmd window, just like in a Linux terminal.

          C Offline
          C Offline
          Calin Negru
          wrote on last edited by
          #4

          notice taken, thank you Richard

          1 Reply Last reply
          0
          • V Victor Nijegorodov

            You can be[Using Pause (The GNU C Library)](https://www.gnu.org/software/libc/manual/html\_node/Using-Pause.html) before return from main().

            C Offline
            C Offline
            Calin Negru
            wrote on last edited by
            #5

            thank you Victor

            1 Reply Last reply
            0
            • L Lost User

              Run it in a cmd window, just like in a Linux terminal.

              J Offline
              J Offline
              jsc42
              wrote on last edited by
              #6

              use

              cmd /k yourapp

              - the /k prevents the window from closing once the app has finished running.

              1 Reply Last reply
              0
              • C Calin Negru

                how do you run a console program with arguments on windows 7? when you run it from the shell the window disapears instantly.

                D Offline
                D Offline
                Deepak Vasudevan
                wrote on last edited by
                #7

                Console.ReadKey() as the ending line in the code can make the environment wait before closing the Terminal window

                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