closing out a command prompt

This is a discussion on closing out a command prompt within the Windows Programming forums, part of the Platform Specific Boards category; I have a program run a batch file and want to know how to close out the command console once ...

  1. #1
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685

    closing out a command prompt

    I have a program run a batch file and want to know how to close out the command console once the batch has been run. Right now I'm using a CreateProcess to do the whole thing.

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    Um...

    If you mean the actual dos window, then the dos command "cls" at the end of your batch script will close the console window when the bat file ends. Write your bat file like so

    Code:
    REM My Bat File
    Dos Command1
    Dos Command2
    cls
    Make sure you dont press enter after cls

  3. #3
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    heheh this is further proof that sometimes the easiest answer is the simplest. I never even thought of closing the batch from the batch itself. Thanks for your common sense Fordy.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. socket programming question, closing sockets...
    By ursula in forum Networking/Device Communication
    Replies: 2
    Last Post: 05-31-2009, 06:17 PM
  2. Interpreter.c
    By moussa in forum C Programming
    Replies: 4
    Last Post: 05-28-2008, 06:59 PM
  3. Stop CFormView from closing
    By bdiamond in forum C++ Programming
    Replies: 2
    Last Post: 08-17-2004, 02:22 PM
  4. Premature closing of threads
    By *ClownPimp* in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 03-07-2003, 11:27 AM
  5. closing microsoft internet explorer
    By canine in forum Windows Programming
    Replies: 11
    Last Post: 03-19-2002, 09:12 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21