tracking exe file in vb6

Posted on 2012-08-30
Last Modified: 2012-08-30
i am trying to track if the exe file which is opened using shell command has been closed or not

for example... i am opening a notepad using shell command in vb6 after closing the notepad how will i track if the opened notepad has been closed in vb6...
Question by:anbuvec
    LVL 83

    Expert Comment

    One way is to get a list of processes and see if its in the list

    But this wont work if the user also has other instances of the same exe open.

    Author Comment

    actually the question is not to see in task manager... just to make a boolean value and then set the boolean to be true when the exe is opened using shell command and then to set the boolean value false when it is closed through vb6 itself
    LVL 83

    Expert Comment

    Can you show the code you use to launch and close exe?
    LVL 8

    Expert Comment

    Actually, Shell command does not have that capability.
    Instead, you may want to explore shell execute instead. It has more functionality compared to shell command.
    LVL 85

    Accepted Solution


    Author Closing Comment

    Thank you Idle_Mind....... that worked....
    LVL 85

    Expert Comment

    by:Mike Tomlinson
    Glad that was useful.  If you're specifically looking for VB6 solutions, though, then you probably shouldn't post the question in the VB.Net area.  =)

    In .Net, the solution is quite simple and completely managed (no APIs required).  It also doesn't require a polling just wire up the Process.Exited() event:
    Very different than VB6!

    The VB6 area is over here:

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
    Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now