• How do I check if a SPECIFIC Dos program is open?

    Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » How do I check if a SPECIFIC Dos program is open?

    Author
    Topic
    #1767744

    I have an Access 97 database and “shell” out to a Dos program to import data from the serial port (proprietary app). I need to know how (In Access VBA code) to check and see:

    1. If the Dos program is still running or not. Checking for any Dos box being open would work just as well as there are no other Dos box apps ever running.

    B. How to shut it down. Keep it mind when shutting down a Dos program that is open you get a dialog box asking if you are sure if you want to terminate because you might lose data (blah, blah, blah..). So I also need to (in code) avoid or answer this box “yes” so it shuts down.

    This problem has plagued me for a couple years now so “Good Luck”!

    Viewing 0 reply threads
    Author
    Replies
    • #1776021

      Hi Eric,

      Check out these articles that describe using API calls for your needs:

      API: Find out if an application is currently running

      API: Close another Application

      Hope this helps
      -MarkJ-

      • #1776037

        Well! This is the closest I have gotten yet. The MS-Dos box class is called “tty”. ALL Ms-Dos sessions open are called that. I still have that same problem with the dialog box. The one that asks if I am sure I want to close it because I might lose information. I’ve tried to Sendkeys but it does not work. Any idea how to answer this box with a “yes” or send an ALT-Y to answer and close the box?
        Thanks again for your help. Worst case scenario I guess I could have the user just click the “yes” button. Cludgy but effective.

    Viewing 0 reply threads
    Reply To: Reply #1776021 in How do I check if a SPECIFIC Dos program is open?

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information:




    Cancel