[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 527
  • Last Modified:

Get a list of Applications from Task Manager not process

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.
  • 2
1 Solution
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.
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 :-

Sorry, looks like that link is dead,

Try this one


Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now