[AccessD] A2003:See if an EXE Is running

James Barash James at fcidms.com
Fri Jan 9 08:35:01 CST 2009


Here is what I've used. It should work under Windows XP and Access 2003, at
least that the only place I've used it.
Hope it helps.
James Barash

Public Function IsExeRunning(strExeName As String) As Boolean
Dim objProcesses As Object, objProcess As Object
  IsExeRunning = False
  Set objProcesses = GetObject("winmgmts://" & Environ$("ComputerName") &
"/root/cimv2").ExecQuery("select * from Win32_Process") 
  If Not objProcesses Is Nothing Then
    For Each objProcess In objProcesses
      If objProcess.Name = strExeName Then
          IsExeRunning = True
          Exit For
      End If
    Next
    Set objProcess = Nothing
    Set objProcesses = Nothing
  End If
End Function
----------------------------------------
> From: darren at activebilling.com.au
> To: accessd at databaseadvisors.com
> Date: Fri, 9 Jan 2009 10:47:45 +1100
> Subject: [AccessD] A2003:See if an EXE Is running
>
> Hi team
>
>
>
> I need some code to see if XYZ.exe or ABC.EXE is 'running' or not (EG
> notepad.exe)
>
> I have found some stuff in VB but am not able to get it to work.
>
> I was just wondering if anyone has done this in Access and is able to
share :-)
> I basically want to see if an app is 'running' then simply report True or
False
> back to my access app.
>
> I don't want to open or close this app - just see if it's 'running'
>
> Many thanks in advance
>
>
>
> DD
>
>
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
_________________________________________________________________
Windows LiveT: Keep your life in sync.
http://windowslive.com/explore?ocid=TXT_TAGLM_WL_t1_allup_explore_012009
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list