Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

CMD flashes on and off

  • 23-09-2011 12:42PM
    #1
    Registered Users, Registered Users 2 Posts: 620 ✭✭✭


    Hi I recently started computer programming. For anyone who has done it i am doing the basic hello world type programs. However my problem is after i compile the file and try to run it the cmd flashes and goes off every time. Now i have tried entering system("pause"); but still this isnt working. Any help would be great!


Comments

  • Closed Accounts Posts: 1,990 ✭✭✭JustAddWater


    have you tried to call the program by opening CMD and navigating to that directory and running it?

    If I have bat files they run and then close the CMD window automatically but when I open CMD first and then call them, the CMD window remains

    Hope that helps!


  • Registered Users, Registered Users 2 Posts: 620 ✭✭✭Laika1986


    I just tried that there and it worked fine! However i still think the problem remains as it wont run from the actual folder! Thanks though at least i know it's working!


  • Moderators, Recreation & Hobbies Moderators, Science, Health & Environment Moderators, Technology & Internet Moderators Posts: 96,078 Mod ✭✭✭✭Capt'n Midnight


    if you "run" a command from the start menu it exits when finished


    http://ss64.com/nt/cmd.html

    /K Carries out My_Command but remains

    haven't tried it since I usually have a cmd shell open somewhere

    cmd /K scriptything


Advertisement