[AccessD] A2003: Testing if a Service or an EXE is Running on another machine

Bill Benson bensonforums at gmail.com
Fri May 5 02:31:18 CDT 2017


I assume you have looked at this one, as your code looks quite similar.

https://www.devhut.net/2014/10/20/vba-wmi-determine-if-a-process-is-running-or-not/

If you can't make that happen because of access rights then I presume that
is going to stop you cold no matter what.

I would think that many hackers could help you get around that, but I doubt
many on this list would want to tell you how, even if they knew (or I would
hope they would not).

On Fri, May 5, 2017 at 3:04 AM, Darren - Active Billing <
darren at activebilling.com.au> wrote:

> Hi Guys,
>
>
>
> Sending this again – got no response last time (sad face)
>
>
>
>
>
> Old Windows boxes – Mix of Server 2003 and XP. I have found some scripting
> to tell me if an executable is running on my local machine. Works great –
> Sample below
>
>
>
> However, I am unable to get it to interrogate a different machine, without
> err. Errors usually relate to permissions.
>
>
>
> Scoured the googles and have tried various things, all to no avail. Has
> anyone successfully got this to work from Access?
>
>
>
> I also want to test if a certain “service” is running on another machine.
> Would appreciate assistance with that too.
>
>
>
> Many thanks in advance
>
>
>
>
>
> Here’s an example of working code interrogating the local machine for an
> Executable. But fails when I pass a machine name or IP Address.
>
>
>
> Function f_IsExeRunning(strExeName As String, Optional strComputer As
> String = ".") As Boolean
>
>
>
> On Error GoTo Err_
>
>
>
>   Dim objProcesses    As Object
>
>
>
>     Set objProcesses = GetObject("winmgmts:{impersonationLevel=impersonate}!\\"
> & strComputer & "\root\cimv2").ExecQuery("SELECT * FROM Win32_Process
> WHERE Name = '" & strExeName & "'")
>
>
>
>     If objProcesses.Count <> 0 Then f_IsExeRunning = True
>
>
>
> Exit_:
>
>
>
>     On Error Resume Next
>
>
>
>     Set objProcesses = Nothing
>
>
>
>     Exit Function
>
>
>
> Err_:
>
>
>
>     MsgBox Err.Number & " " & Err.Description, vbCritical, "An Error has
> Occured"
>
>
>
>     Resume Exit_
>
>
>
> End Function
>
>
>
> --
> 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