Setting a .BAT file to 'Close on Exit'? API call?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Setting a .BAT file to 'Close on Exit'? API call?

  1. #1
    Chris L. Guest

    Setting a .BAT file to 'Close on Exit'? API call?


    I'm creating batch file on the fly, executing it in hidden mode with the shell
    command, and then closing the file. The problem is how to close the .BAT
    file after it's completed it's task. It appears the easiest way would be
    to 'turn on' the close on exit option of a .BAT file after I've created the
    file in my code. Does anyone know how to do this?

    The only other option would be to use the TerminateProcess api call which
    I've been having a heck of a time getting to work (Yes I've gone back through
    what Bryan and Karl have posted - even referenced the 'API GUIDE' program).

    Thanks,
    Chris L.

  2. #2
    Bob Butler Guest

    Re: Setting a .BAT file to 'Close on Exit'? API call?

    "Chris L." <clintvedt@ifcu.com> wrote in message
    news:3b66db7a$1@news.devx.com...
    >
    > I'm creating batch file on the fly, executing it in hidden mode with the

    shell
    > command, and then closing the file. The problem is how to close the .BAT
    > file after it's completed it's task. It appears the easiest way would be
    > to 'turn on' the close on exit option of a .BAT file after I've created

    the
    > file in my code. Does anyone know how to do this?


    try ending the BAT file with these 2 lines:

    @Echo Off
    CLS

    Regardless of the 'Close on Exit' setting, if the DOS window is blank it
    closes anyway




  3. #3
    Bob Butler Guest

    Re: Setting a .BAT file to 'Close on Exit'? API call?

    "Chris L." <clintvedt@ifcu.com> wrote in message
    news:3b66db7a$1@news.devx.com...
    >
    > I'm creating batch file on the fly, executing it in hidden mode with the

    shell
    > command, and then closing the file. The problem is how to close the .BAT
    > file after it's completed it's task. It appears the easiest way would be
    > to 'turn on' the close on exit option of a .BAT file after I've created

    the
    > file in my code. Does anyone know how to do this?


    try ending the BAT file with these 2 lines:

    @Echo Off
    CLS

    Regardless of the 'Close on Exit' setting, if the DOS window is blank it
    closes anyway




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center