Command Prompt

Page 1 of 2 12 LastLast

  1. Posts : 4
    Windows 7 Home Premium 64bit
       #1

    Command Prompt


    Ok so every time I try to open the command prompt using an external source (batch file, small c++ program i made to say Hi to me through the command prompt) it instantly closes. Does anyone have any idea why this is happening and if so how can I fix it?

    Thanks,
    Wave
      My Computer


  2. ryo
    Posts : 1,953
    windows 7
       #2

    hi and welcome,
    maybe your script error?
    and for what you have to make like that???
      My Computer


  3. Posts : 10,455
    Microsoft Windows 7 Home Premium 64-bit Service Pack 1
       #3

    You can also make the cmd widow stay open with the /k switch

    Command Prompt-capture.jpg
      My Computer


  4. Posts : 1,814
    XP / Win7 x64 Pro
       #4

    That sounds about right. If you launch cmd from a script it won't stay open unless you have a pause built-in or it's waiting for input. The fix is in your programming.
      My Computer


  5. TCG
    Posts : 190
    .
       #5

    FliGi7 said:
    That sounds about right. If you launch cmd from a script it won't stay open unless you have a pause built-in or it's waiting for input. The fix is in your programming.
    Indeed. This is normal behavior.

    An alternative would be to run the batch file from an already open command prompt window if you'd like to see the output without changing the script in any way. Easiest solution would be to add a pause on the last line of your batch file.
      My Computer


  6. Posts : 22,814
    W 7 64-bit Ultimate
       #6

    Hello wave407, welcome to Seven Forums!



    I use the method outlined in this tutorial at the link below to add a shortcut to the desktop that opens an elevated command window with one click.


    Elevated Program Shortcut without UAC Prompt - Create

    click to enlarge
    Command Prompt-task_cmd.jpg
      My Computer


  7. Posts : 4
    Windows 7 Home Premium 64bit
    Thread Starter
       #7

    See that is why i am confused...I do have a pause built in to my hello message and the batch file I'm trying to use I didn't make but I tried it on my other computer and it opens up and stays open
      My Computer


  8. TCG
    Posts : 190
    .
       #8

    Try running the batch file from an already opened command prompt, this should at least spit out the output so you can see it, and hopefully an error of some sort telling you what is wrong.
      My Computer


  9. Posts : 4
    Windows 7 Home Premium 64bit
    Thread Starter
       #9

    ok i figured it out...Thanks guys I really appreciate it
      My Computer


  10. Posts : 10,455
    Microsoft Windows 7 Home Premium 64-bit Service Pack 1
       #10

    You are welcome. Would you care to share the solution with us to help others?
      My Computer


 
Page 1 of 2 12 LastLast

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 08:19.
Find Us