Thread: running application from command prompt

  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    630

    running application from command prompt

    Hello..

    When I run my application from command prompt, how can I terminate it without closing command prompt? (so that I stay in a directory where I previously went to)

    Thanks for help

  2. #2
    Registered User
    Join Date
    Apr 2006
    Posts
    20
    Press 'Ctrl+C', that should work.

    (If not then try 'Ctrl+J')

  3. #3
    Registered User
    Join Date
    May 2006
    Posts
    630
    Thanks. Ctrl + C works

  4. #4
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    Also, in rare cases where CTRL-C does not work, CTRL-break sometimes does.

    If it's your application that you're running you should code it so that you don't have to press CTRL-C. If you put a cin.get() or something at the end, just press enter and it should exit on its own. Unless you have an infinite loop or something.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  5. #5
    Registered User
    Join Date
    May 2006
    Posts
    630
    Yes, I have infinite loop.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. need to edit text from within my application.
    By spiroth10 in forum C++ Programming
    Replies: 2
    Last Post: 12-15-2006, 03:15 PM
  2. Replies: 1
    Last Post: 09-18-2005, 09:06 PM
  3. Changing focus in an MFC Application
    By rangalo in forum Windows Programming
    Replies: 2
    Last Post: 06-20-2005, 06:21 AM
  4. MFC run application by clicking on file...
    By dug in forum Windows Programming
    Replies: 4
    Last Post: 12-02-2004, 04:33 AM
  5. Application running as a process in Win2k?????
    By J_Bravo in forum Windows Programming
    Replies: 8
    Last Post: 05-07-2002, 04:02 AM