Get a list of Applications from Task Manager not process

Posted on 2006-04-27
Last Modified: 2013-12-03
There are lots of variations of this code on EE to retrieve the process that are running

Dim strWinMgt As String
Dim process As Object
Dim objProc As Object
Dim ComName As String
ComName = "YourComputername"

strWinMgt = "winmgmts://" & ComName & ""
Set objProc = GetObject(strWinMgt).ExecQuery("Select * from Win32_Process")
For Each process In objProc
   List1.additem process.Name      

What I need is something that give me a specific file name as listed in the Task Manager application tab.  So instead of finding  Microsoft Word or winword.exe, I need to see if the file Test.doc  is open on this computer.  I can't use word automation because I may be looking for a tif file or a pdf file. I know in advance the full path name of the file, I just need to test to see if it is currently open.
Question by:Mach1pro
    LVL 29

    Expert Comment

    As far as I know this can't be done and especially won't happen using vbscript. I have never seen any API that gets this deep into pulling out the actual filename of the document. I know that you can count how many handles are open from another process but this doesn't help much in determining what you need to do. The applications tab just shows the captions of the windows that are currently open not the actuall filename on your computer but the associated applications caption of the process that is handling the file.
    LVL 3

    Expert Comment

    You could look through the open windows captions and see the the file name is showing, ie from the applications list in task manager.

    You can find some source code for this here :-
    LVL 3

    Accepted Solution

    Sorry, looks like that link is dead,

    Try this one

    Featured Post

    Live: Real-Time Solutions, Start Here

    Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

    Join & Write a Comment

    Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
    Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    733 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

    23 Experts available now in Live!

    Get 1:1 Help Now