Bill Patten
bill_patten at embarqmail.com
Fri Jan 9 12:08:15 CST 2009
Wow, is that cool. Add debug.print under "For Each objProcess In objProcesses" and watch the immediate window and enter a name of a program you know is not running. You will probably be surprised at what is running. Then go here to see some of the other things you can do with it, like close a program, or identify the owner or even change the priority. http://www.activexperts.com/activmonitor/windowsmanagement/scripts/operatingsystem/processes/processes/ It worked fine on my Vista 64 machine as well, and perhaps explains how hackers can gain control of a PC. I wonder if in a more secure PC if scripting would be disabled so that the code might not work on all your clients machines. I'm putting it in my toolbox anyway. Bill ----- Original Message ----- From: "Jack and Pat" <drawbridgej at sympatico.ca> To: "'Access Developers discussion and problem solving'" <accessd at databaseadvisors.com> Sent: Friday, January 09, 2009 7:25 AM Subject: Re: [AccessD] A2003:See if an EXE Is running That is great. Works fine and is sure short and sweet on XP SP3 A2003 -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of James Barash Sent: Friday, January 09, 2009 9:35 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] A2003:See if an EXE Is running 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 -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG - http://www.avg.com Version: 8.0.176 / Virus Database: 270.10.5/1881 - Release Date: 1/9/2009 8:38 AM -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com