[AccessD] A2003: Testing if a Service or an EXE is Running on another machine
Darren - Active Billing
darren at activebilling.com.au
Fri May 5 02:44:19 CDT 2017
Many thanks for the prompt reply, Bill.
Yes, I think that link you posted is where I got the original code. (Or at least parts/most of it)
We have a few VM’s (Virtual Machines) and it’s these various VM’s that I want to interrogate – all on the same network.
Would allow me to write a nice tool, if I could test if an EXE and/or Service was running across machines…shame.
Again – Many thanks.
Darren
From: AccessD <accessd-bounces at databaseadvisors.com> on behalf of Bill Benson <bensonforums at gmail.com>
Reply-To: Access Developers discussion and problem solving <accessd at databaseadvisors.com>
Date: Friday, 5 May 2017 5:31 pm
To: Access Developers discussion and problem solving <accessd at databaseadvisors.com>
Subject: Re: [AccessD] A2003: Testing if a Service or an EXE is Running on another machine
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
--
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